-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
45 lines (42 loc) · 1.22 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
var Encore = require('@symfony/webpack-encore');
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.addEntry('app', './assets/vue/index.js')
.addEntry('pay', './assets/js/pay.js')
.copyFiles({
from: './assets/images',
to: 'images/[path][name].[ext]',
pattern: /\.(png|jpg|jpeg|ico|svg)$/
})
.splitEntryChunks()
.disableSingleRuntimeChunk()
.cleanupOutputBeforeBuild()
.enableBuildNotifications()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.configureBabel((babelConfig) => {
babelConfig.plugins.push('@babel/plugin-transform-runtime');
}, {
useBuiltIns: 'usage',
corejs: 3
})
.enableVueLoader()
.enableIntegrityHashes()
.enableLessLoader()
.addLoader({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules|vendor)/,
options: {
fix: true,
emitError: true,
emitWarning: true,
},
})
;
module.exports = Encore.getWebpackConfig();