forked from RobinStudo/music-one
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
47 lines (37 loc) · 1.49 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
45
46
47
const Encore = require('@symfony/webpack-encore');
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.addEntry('app', './assets/js/app.js')
.addEntry('event_index', './assets/js/pages/event/index.js')
.addEntry('event_show', './assets/js/pages/event/show.js')
.addEntry('event_form', '/assets/js/pages/event/form.js')
.addEntry('security_register', '/assets/js/pages/security/register.js')
.addEntry('checkout_cart', '/assets/js/pages/checkout/cart.js')
.addEntry('checkout_account', '/assets/js/pages/checkout/account.js')
.addEntry('checkout_payment', '/assets/js/pages/checkout/payment.js')
.addEntry('checkout_finish', '/assets/js/pages/checkout/finish.js')
.splitEntryChunks()
.enableSingleRuntimeChunk()
.cleanupOutputBeforeBuild()
.enableBuildNotifications()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.configureBabel((config) => {
config.plugins.push('@babel/plugin-proposal-class-properties');
})
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = 3;
})
.enableSassLoader()
.enableIntegrityHashes(Encore.isProduction())
.copyFiles({
from: './assets/images',
to: 'images/[path][name].[hash:8].[ext]',
})
;
module.exports = Encore.getWebpackConfig();