-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
webpack.config.js
40 lines (31 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
const path = require('path');
const Encore = require('@symfony/webpack-encore');
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
Encore
.autoProvidejQuery()
.setOutputPath('./Bundle/AdminBundle/public/')
.setPublicPath('/bundles/umbrellaadmin/')
.setManifestKeyPrefix('bundles/umbrellaadmin')
.addAliases({
umbrella_core: path.join(__dirname, '/Bundle/CoreBundle/assets/'),
umbrella_admin: path.join(__dirname, '/Bundle/AdminBundle/assets/'),
})
.addEntry('admin', './Bundle/AdminBundle/assets/admin.js')
.enableSassLoader()
.disableSingleRuntimeChunk()
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = '3.23';
})
// add hash after file name
.configureFilenames({
js: '[name].js?[chunkhash]',
css: '[name].css?[contenthash]',
})
;
module.exports = Encore.getWebpackConfig();