-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.js
44 lines (39 loc) · 1.76 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
44
// webpack.config.js
var Encore = require('@symfony/webpack-encore');
Encore
// directory where all compiled assets will be stored
.setOutputPath('web/assets/js')
// what's the public path to this directory (relative to your project's document root dir)
.setPublicPath('/assets/js')
// empty the outputPath dir before each build
.cleanupOutputBeforeBuild()
.configureBabel(function(babelConfig) {
// add additional presets
babelConfig.presets.push('es2017');
// no plugins are added by default, but you can add some
// babelConfig.plugins = ['styled-jsx/babel'];
})
.enableReactPreset()
// will output as web/build/app.js
.addEntry('project/details', ['./app/Resources/client/jsx/project/details.jsx'])
.addEntry('project/helpers', ['./app/Resources/client/jsx/project/helpers.jsx'])
.addEntry('project/traitDetails', ['./app/Resources/client/jsx/project/traitDetails.jsx'])
.addEntry('organism/details', ['./app/Resources/client/jsx/organism/details.jsx'])
.addEntry('organism/search', ['./app/Resources/client/jsx/organism/search.jsx'])
.addEntry('trait/browse', ['./app/Resources/client/jsx/trait/browse.jsx'])
.addEntry('trait/search', ['./app/Resources/client/jsx/trait/search.jsx'])
.addEntry('trait/myTraits', ['./app/Resources/client/jsx/trait/myTraits.jsx'])
.enableSassLoader()
.createSharedEntry('global', [
'babel-polyfill',
'lodash',
'jquery',
'./app/Resources/client/jsx/base.jsx',
'./app/Resources/client/jsx/helpers.jsx',
'./app/Resources/client/scss/base.scss'
])
.autoProvidejQuery()
.enableSourceMaps(!Encore.isProduction())
;
// export the final configuration
module.exports = Encore.getWebpackConfig();