-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
32 lines (28 loc) · 947 Bytes
/
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
var Encore = require('@symfony/webpack-encore');
require('dotenv').config();
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
var publicPath = '/app-starter/www/build/admin';
var prodHost = process.env.PROD_HOST;
if (prodHost !== undefined) {
publicPath = '/build/admin';
}
Encore
.setOutputPath('./www/build/admin')
.setPublicPath(publicPath)
.addEntry('admin', './assets/app.ts')
.splitEntryChunks()
.enableSingleRuntimeChunk()
.cleanupOutputBeforeBuild(['**/*', '!.gitkeep'])
.enableBuildNotifications()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = 3;
})
.enableSassLoader()
.enablePostCssLoader()
.enableTypeScriptLoader();
module.exports = Encore.getWebpackConfig();