-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
39 lines (31 loc) · 1.02 KB
/
Copy pathwebpack.config.js
File metadata and controls
39 lines (31 loc) · 1.02 KB
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
import Encore from '@symfony/webpack-encore';
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.addEntry('app', './assets/app.js')
.disableSingleRuntimeChunk()
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.enableSassLoader()
.enablePostCssLoader()
.autoProvidejQuery()
.autoProvideVariables({
CodeMirror: 'codemirror',
})
// Encore 7 no longer bundles a CSS minifier, it has to be picked explicitly
.configureCssMinimizerPlugin((options, MinimizerPlugin) => {
options.minify = MinimizerPlugin.cssnanoMinify;
})
// configure Babel
.configureBabel((config) => {
config.plugins.push([
'polyfill-corejs3',
{ method: 'usage-global', version: '3.49' },
]);
})
;
export default await Encore.getWebpackConfig();