forked from kimai/kimai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
48 lines (35 loc) · 1.36 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
var Encore = require('@symfony/webpack-encore');
Encore
// the project directory where compiled assets will be stored
.setOutputPath('public/build/')
// the public path used by the web server to access the previous directory
.setPublicPath('/build/')
// 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())
// generate only two files: app.js and app.css
.addEntry('app', './assets/js/app.js')
// enable sass/scss parser
.enableSassLoader()
// show OS notifications when builds finish/fail
.enableBuildNotifications()
// empty the outputPath dir before each build
.cleanupOutputBeforeBuild()
// load jquery as Kimai and AdminLTE rely on it
.autoProvidejQuery()
// see https://symfony.com/doc/current/frontend/encore/bootstrap.html
.enableSassLoader(function(sassOptions) {}, {
resolveUrlLoader: false
})
// add hash after file name
.configureFilenames({
js: '[name].js?[chunkhash]',
css: '[name].css?[contenthash]',
images: 'images/[name].[ext]?[hash:8]',
fonts: 'fonts/[name].[ext]?[hash:8]'
})
;
module.exports = Encore.getWebpackConfig();