-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
72 lines (63 loc) · 2.49 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// This project uses "Yarn" package manager for managing JavaScript dependencies along
// with "Webpack Encore" library that helps working with the CSS and JavaScript files
// that are stored in the "assets/" directory.
//
// Read https://symfony.com/doc/current/frontend.html to learn more about how
// to manage CSS and JavaScript files in Symfony applications.
var Encore = require('@symfony/webpack-encore');
var path = require('path');
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.cleanupOutputBeforeBuild()
.autoProvidejQuery()
.autoProvideVariables({
"jQuery.tagsinput": "bootstrap-tagsinput"
})
.enableSassLoader()
// when versioning is enabled, each filename will include a hash that changes
// whenever the contents of that file change. This allows you to use aggressive
// caching strategies. Use Encore.isProduction() to enable it only for production.
.enableVersioning(false)
.addEntry('app', './assets/js/app.js')
.addEntry('login', './assets/js/login.js')
.addEntry('admin', './assets/js/admin.js')
.addEntry('search', './assets/js/search.js')
.addEntry('clipboard', './assets/js/clipboard.js')
.addEntry('corazones', './assets/js/corazones.js')
.addEntry('app_corazones', './assets/js/app_corazones.js')
.splitEntryChunks()
.enableSingleRuntimeChunk()
// .enableIntegrityHashes(Encore.isProduction())
.configureBabel(null, {
useBuiltIns: 'usage',
corejs: 3,
})
.splitEntryChunks()
// will require an extra script tag for runtime.js
// but, you probably want this, unless you're building a single-page app
.enableSingleRuntimeChunk()
// This is our alias to the root vue components dir
.addAliases({
'@': path.resolve(__dirname, 'assets', 'js'),
styles: path.resolve(__dirname, 'assets', 'scss'),
})
.copyFiles({
from: './assets/images',
to: Encore.isProduction()
? 'images/[path][name].[hash:8].[ext]'
: 'images/[path][name].[ext]',
})
// Enable .vue file processing
// .enableVueLoader()
.enableVueLoader(() => {}, { runtimeCompilerBuild: true })
// gives better module CSS naming in dev
.configureCssLoader((config) => {
if (!Encore.isProduction() && config.modules) {
config.modules.localIdentName = '[name]_[local]_[hash:base64:5]';
}
})
// enables Sass/SCSS support
.enableSassLoader()
;
module.exports = Encore.getWebpackConfig();