mirror of
https://github.com/wallabag/wallabag.git
synced 2025-06-27 16:36:00 +00:00
Use Webpack Encore
This commit is contained in:
parent
04e757dcc8
commit
f261247766
18 changed files with 1271 additions and 256 deletions
|
@ -1,8 +1,36 @@
|
|||
const path = require('path');
|
||||
const Encore = require('@symfony/webpack-encore');
|
||||
const StyleLintPlugin = require('stylelint-webpack-plugin');
|
||||
|
||||
function buildConfig(options) {
|
||||
const env = options.prod ? 'prod' : 'dev';
|
||||
return require(path.resolve(__dirname, `app/config/webpack/${env}.js`));
|
||||
if (!Encore.isRuntimeEnvironmentConfigured()) {
|
||||
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
|
||||
}
|
||||
|
||||
module.exports = buildConfig;
|
||||
Encore
|
||||
.setOutputPath('web/build/')
|
||||
.setPublicPath('/build')
|
||||
.addEntry('main', './assets/index.js')
|
||||
.addEntry('public', './assets/share.js')
|
||||
.splitEntryChunks()
|
||||
.enableSingleRuntimeChunk()
|
||||
.cleanupOutputBeforeBuild()
|
||||
.enableBuildNotifications()
|
||||
.enableSourceMaps(!Encore.isProduction())
|
||||
.enableVersioning(Encore.isProduction())
|
||||
.configureBabelPresetEnv((config) => {
|
||||
config.modules = false;
|
||||
config.useBuiltIns = 'usage';
|
||||
config.corejs = '3.23';
|
||||
})
|
||||
.enableSassLoader()
|
||||
.enablePostCssLoader()
|
||||
.autoProvidejQuery()
|
||||
.enableEslintPlugin()
|
||||
.addPlugin(new StyleLintPlugin({
|
||||
configFile: 'stylelint.config.js',
|
||||
failOnError: false,
|
||||
quiet: false,
|
||||
context: 'assets',
|
||||
files: '**/*.scss',
|
||||
}));
|
||||
|
||||
module.exports = Encore.getWebpackConfig();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue