/
webpack.config.js
35 lines (29 loc) · 1.04 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
var Encore = require('@symfony/webpack-encore');
const path = require('path');
Encore
.setOutputPath('src/Resources/public/js/')
.addEntry('contao-speed-bundle', '@hundh/contao-speed-bundle')
.setPublicPath('/public/js/')
.disableSingleRuntimeChunk()
.configureBabel(() => {}, {
exclude: (filePath) => {
// Don't exclude files outside of node_modules
if (!/node_modules/.test(filePath)) {
return false;
}
// Don't exclude whitelisted modules
const whitelistedModules = ['@hundh' + path.sep + 'contao-speed-bundle'].map(
module => path.join('node_modules', module) + path.sep
);
for (const modulePath of whitelistedModules) {
if (filePath.includes(modulePath)) {
return false;
}
}
// Exclude other files
return true;
}
})
.enableSourceMaps(!Encore.isProduction())
;
module.exports = Encore.getWebpackConfig();