-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
35 lines (31 loc) · 1.26 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
var Encore = require('@symfony/webpack-encore');
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.configureBabel(function(babelConfig) {
// add additional presets
babelConfig.plugins.push('@babel/plugin-proposal-class-properties');
babelConfig.plugins.push('transform-object-rest-spread');
babelConfig.plugins.push('transform-react-jsx');
// no plugins are added by default, but you can add some
// babelConfig.plugins.push('styled-jsx/babel');
}, {
// node_modules is not processed through Babel by default
// but you can whitelist specific modules to process
// include_node_modules: ['foundation-sites']
// or completely control the exclude
// exclude: /bower_components/
})
.addStyleEntry('css/main', './assets/styles/main.scss')
// allow legacy applications to use $/jQuery as a global variable
.autoProvidejQuery()
.addEntry('js/app', './assets/js/index.js')
.addEntry('js/admin', './assets/js/entryPoint.js')
.enableSassLoader()
.enableReactPreset()
.disableSingleRuntimeChunk()
;
module.exports = Encore.getWebpackConfig();