-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
webpack.config.js
53 lines (40 loc) · 1.56 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
var Encore = require('@symfony/webpack-encore');
Encore
// the project directory where compiled assets will be stored
.setOutputPath('public/')
// the public path used by the web server to access the previous directory
.setPublicPath('/bundles/tabler/')
// make sure the manifest prefix matches the structure in the real application
.setManifestKeyPrefix('bundles/tabler/')
// delete old files before creating them
.cleanupOutputBeforeBuild()
// add debug data in development
.enableSourceMaps(!Encore.isProduction())
// uncomment to create hashed filenames (e.g. app.abc123.css)
.enableVersioning(Encore.isProduction())
.addEntry('tabler', './assets/tabler.js')
.addEntry('tabler-rtl', './assets/tabler-rtl.js')
// disabled as ""webpack-notifier": "^1.13"" id currently not compatible with ARM systems
//.enableBuildNotifications()
// don't use a runtime.js
.disableSingleRuntimeChunk()
// empty the outputPath dir before each build
.cleanupOutputBeforeBuild()
// enable sass/scss parser
// see https://symfony.com/doc/current/frontend/encore/bootstrap.html
.enableSassLoader(function(sassOptions) {}, {
resolveUrlLoader: false
})
// add hash after file name
.configureImageRule({
filename: 'images/[name][ext]?[hash:8]',
})
.configureFontRule({
filename: 'fonts/[name][ext]?[hash:8]'
})
.configureFilenames({
js: '[name].js?[chunkhash]',
css: '[name].css?[contenthash]',
})
;
module.exports = Encore.getWebpackConfig();