-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
52 lines (41 loc) · 1.48 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
48
49
50
51
52
const Encore = require('@symfony/webpack-encore');
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
Encore
.setOutputPath('dist/')
.setPublicPath('/dist')
.cleanupOutputBeforeBuild()
.splitEntryChunks()
.enableSingleRuntimeChunk()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.enableBuildNotifications()
.enablePostCssLoader()
.configureManifestPlugin((options) => {
options.fileName = '../_data/manifest.yml';
})
.copyFiles({
from: './assets/images',
to: 'images/[path][name].[ext]',
})
.copyFiles({
from: './assets/sounds',
to: 'sounds/[path][name].[ext]',
})
.addEntry('homepage', './assets/js/homepage.js')
.addEntry('main', './assets/js/main.js')
.addEntry('adapter-flasher', './assets/js/adapter/flasher.js')
.addEntry('adapter-noty', './assets/js/adapter/noty.js')
.addEntry('adapter-notyf', './assets/js/adapter/notyf.js')
.addEntry('adapter-pnotify', './assets/js/adapter/pnotify.js')
.addEntry('adapter-sweetalert', './assets/js/adapter/sweetalert.js')
.addEntry('adapter-toastr', './assets/js/adapter/toastr.js')
;
const config = Encore.getWebpackConfig();
config.plugins.forEach((plugin) => {
if (plugin.constructor.name === 'AssetsWebpackPlugin') {
plugin.options.filename = '../_data/entrypoints.yml';
}
});
module.exports = config;