-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
43 lines (38 loc) · 1.09 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
38
39
40
41
42
43
let webpack = require('webpack');
let Encore = require('@symfony/webpack-encore');
Encore
.enableSingleRuntimeChunk()
.enablePostCssLoader()
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
.addEntry('js/app', './assets/js/app.js')
.addEntry('js/gallery', './assets/js/gallery.js')
.addStyleEntry('css/app', './assets/css/app.sass')
.addStyleEntry('css/home', './assets/css/home.sass')
.addStyleEntry('css/form', './assets/css/form.sass')
.addStyleEntry('css/gallery', './assets/css/gallery.sass')
.enableSassLoader()
;
if (Encore.isProduction()) {
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.enableVersioning()
;
} else {
Encore
.setOutputPath('public/build/')
.setPublicPath('http://localhost:8080/')
.setManifestKeyPrefix('build/')
.cleanupOutputBeforeBuild()
.enableSourceMaps()
;
}
let config = Encore.getWebpackConfig();
config.plugins.push(new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
Popper: ['popper.js', 'default']
}));
module.exports = config;