-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
50 lines (37 loc) · 1.13 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
const { join } = require('path')
const Encore = require('@symfony/webpack-encore')
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment('dev');
}
Encore.setOutputPath('./../../public/assets/')
Encore.setPublicPath('/assets/')
Encore.addEntry('app', './src/UI/Resources/js/app.js')
Encore.disableSingleRuntimeChunk()
Encore.cleanupOutputBeforeBuild()
Encore.enableSourceMaps(!Encore.isProduction())
Encore.enableVersioning(Encore.isProduction())
Encore.configureDevServerOptions((options) => {
/**
* Normalize "options.static" property to an array
*/
if (!options.static) {
options.static = []
} else if (!Array.isArray(options.static)) {
options.static = [options.static]
}
/**
* Enable live reload and add views directory
*/
options.liveReload = true
options.static.push({
directory: join(__dirname, '../src/UI/Resources/views'),
watch: true,
})
})
Encore.enablePostCssLoader();
const config = Encore.getWebpackConfig()
config.infrastructureLogging = {
level: 'warn',
}
config.stats = 'errors-warnings'
module.exports = config