-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
31 lines (26 loc) · 961 Bytes
/
webpack.config.js
File metadata and controls
31 lines (26 loc) · 961 Bytes
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
const Encore = require('@symfony/webpack-encore');
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
const ENTRIES = ["home", "base", "404", "login", "register", "profile", "question", "questions", "questionCreate"];
Encore
.setOutputPath('public/assets/')
.setPublicPath('/assets')
.splitEntryChunks()
.enableSingleRuntimeChunk()
.cleanupOutputBeforeBuild(["*.js", "*.css"])
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.enableSassLoader()
.configureBabel((config) => {
config.plugins.push('@babel/plugin-proposal-class-properties');
})
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = 3;
})
;
for (let entry in ENTRIES) {
Encore.addEntry(ENTRIES[entry], `./assets/${ENTRIES[entry]}.js`);
}
module.exports = Encore.getWebpackConfig();