-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
58 lines (48 loc) · 1.74 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
53
54
55
56
57
58
const WebpackBar = require('webpackbar');
const Encore = require('@symfony/webpack-encore');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
if (!Encore.isProduction()) {
Encore.addPlugin(new HtmlWebpackPlugin());
Encore.addPlugin(new CleanWebpackPlugin());
Encore.configureFilenames({
css: '[name].[contenthash].css',
js: '[name].[contenthash].js',
});
}
Encore
.addPlugin(
new WebpackBar({
profile: Encore.isProduction(),
minimal: false,
}),
)
.setOutputPath('public/assets/')
.setPublicPath('/assets')
.setManifestKeyPrefix('assets')
.copyFiles({
from: './assets/static',
})
.cleanupOutputBeforeBuild()
.disableSingleRuntimeChunk()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(false)
.addEntry('bolt', './assets/js/bolt.js')
.addEntry('zxcvbn', './assets/js/zxcvbn.js')
.addEntry('vibrant', './assets/js/vibrant.js')
.addStyleEntry('theme-default', './assets/scss/themes/default.scss')
.addStyleEntry('theme-light', './assets/scss/themes/light.scss')
.addStyleEntry('theme-dark', './assets/scss/themes/dark.scss')
.addStyleEntry('theme-woordpers', './assets/scss/themes/woordpers.scss')
.splitEntryChunks()
.autoProvidejQuery()
.enableVueLoader()
.enableSassLoader()
.enablePostCssLoader()
.enableVueLoader(() => {}, { runtimeCompilerBuild: true });
module.exports = Encore.getWebpackConfig();