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