-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
37 lines (34 loc) · 1.06 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
const Encore = require('@symfony/webpack-encore');
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.copyFiles([
{from: './assets/images', to: 'images/[path][name].[ext]'},
{from: './assets/vectors', to: 'vectors/[path][name].[ext]'},
])
/*
* ENTRY CONFIG
*/
.addEntry('admin', './assets/admin.js')
.addEntry('web', './assets/web.js')
.addEntry('project_detail', './assets/project_detail.js')
.splitEntryChunks()
.enableStimulusBridge('./assets/controllers.json')
.enableSingleRuntimeChunk()
/*
* FEATURE CONFIG
*/
.cleanupOutputBeforeBuild()
.enableBuildNotifications()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = '3.23';
})
.enableSassLoader()
;
module.exports = Encore.getWebpackConfig();