-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
37 lines (35 loc) · 1.35 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const Encore = require('@symfony/webpack-encore');
const StyleLintPlugin = require('stylelint-webpack-plugin');
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.addEntry('app', './src/Resources/js/app.js')
.addEntry('admin_news', './src/Resources/js/page/admin-news.js')
.addEntry('gallery', './src/Resources/js/page/gallery.js')
.addEntry('news', './src/Resources/js/page/news.js')
.addEntry('users', './src/Resources/js/page/users.js')
.addStyleEntry('main', './src/Resources/scss/main.scss')
.addStyleEntry('page_admin_news', './src/Resources/scss/page/admin-news.scss')
.addStyleEntry('page_news', './src/Resources/scss/page/news.scss')
.addStyleEntry('page_users', './src/Resources/scss/page/users.scss')
.addStyleEntry('user_styles', './src/Resources/scss/theme/user-styles.scss')
.splitEntryChunks()
.enableSassLoader()
.enablePostCssLoader()
.enableSourceMaps(!Encore.isProduction())
.cleanupOutputBeforeBuild()
.enableVersioning()
.enableSingleRuntimeChunk()
.autoProvidejQuery()
.copyFiles({
from: './src/Resources/img',
to: 'images/[path][name].[ext]',
})
.configureBabel((babelConfig) => {
babelConfig.plugins.push('@babel/plugin-proposal-object-rest-spread');
})
.addPlugin(new StyleLintPlugin({
context: 'src',
emitErrors: false,
}));
module.exports = Encore.getWebpackConfig();