This repository was archived by the owner on Dec 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
44 lines (41 loc) · 1.46 KB
/
Copy pathwebpack.config.js
File metadata and controls
44 lines (41 loc) · 1.46 KB
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
38
39
40
41
42
43
44
const Encore = require('@symfony/webpack-encore');
const webpack = require('webpack');
Encore
//Set all path
.setOutputPath('public/build/')
.setPublicPath('/build')
//Clean olds files
.cleanupOutputBeforeBuild()
//JS
.addEntry('js/vendor/scroll', './Resources/assets/js/vendor/scroll.min.js')
.addEntry('js/forum/app', './Resources/assets/js/forum/app.js')
.addEntry('js/forum/auth', './Resources/assets/js/forum/auth.js')
//CSS
.addStyleEntry('css/forum/style', './Resources/assets/scss/forum/style.scss')
.addStyleEntry('css/vendor/bootstrap', './Resources/assets/scss/bootstrap.scss')
.addStyleEntry('css/vendor/font-awesome', './Resources/assets/scss/font-awesome/font-awesome.scss')
//Add public
.addPlugin(new webpack.ProvidePlugin({ Cookies: 'js-cookie/src/js.cookie.js' }))
//Add shared
.createSharedEntry('js/vendor', './webpack.shared.js')
.enableSingleRuntimeChunk()
//Set css settings
.enableSassLoader()
.enablePostCssLoader((options) => {
options.config = {
path: 'config/postcss.config.js'
};
})
//Set babel
.configureBabel(function(babelConfig) {
})
//Makes jQuery available everywhere
.autoProvidejQuery()
//Set source maps
.enableSourceMaps(!Encore.isProduction())
//Set versioning
.enableVersioning(Encore.isProduction())
//Add Notifications
.enableBuildNotifications()
;
module.exports = Encore.getWebpackConfig();