This repository has been archived by the owner on Sep 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
57 lines (40 loc) · 2.11 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
54
55
56
57
const Encore = require('@symfony/webpack-encore');
Encore
// Directory where compiled assets will be stored.
.setOutputPath('web/build/')
// Public path used by the web server to access the output path.
.setPublicPath('/build')
// Only needed for CDN's or sub-directory deploy.
// .setManifestKeyPrefix('build/')
// Main entry for JS required globally. File includes a reference to assets/css/app.scss for CSS required globally.
.addEntry('app', './assets/js/app.js')
/*
Entries for JS tied to a specific page/feature.
Each file can optionally include a reference to a CSS file tied to the same page/feature.
*/
.addEntry('account-information', './assets/js/components/user/account-information.js')
.addEntry('email-change', './assets/js/components/user/email-change.js')
.addEntry('login', './assets/js/views/user/login.js')
.addEntry('password-change', './assets/js/components/user/password-change.js')
.addEntry('password-strength-meter', './assets/js/components/password-strength-meter.js')
.addEntry('registration', './assets/js/views/user/registration.js')
// Splits entries into chunks to avoid code duplication (e.g. two page-tied JS files both importing jQuery).
.splitEntryChunks()
// Allows sass/scss files to be processed.
.enableSassLoader()
// Allows legacy applications to use $/jQuery as a global variable.
.autoProvidejQuery()
.enableSourceMaps(!Encore.isProduction())
// Enables hashed filenames (e.g. app.abc123.css). It forces browser to clear old assets from cache.
.enableVersioning()
// Purges the outputPath directory before each build (doesn't work on subsequent builds triggered by --watch).
.cleanupOutputBeforeBuild()
// Requires an extra script tag for runtime.js which must be loaded before any other script tag.
.enableSingleRuntimeChunk()
// Uncomment if you use TypeScript.
// .enableTypeScriptLoader()
// Shows OS notifications when builds finish/fail.
// .enableBuildNotifications()
;
// Exports the final configuration.
module.exports = Encore.getWebpackConfig();