-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebpack.config.js
More file actions
39 lines (34 loc) · 1.12 KB
/
webpack.config.js
File metadata and controls
39 lines (34 loc) · 1.12 KB
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
const Encore = require('@symfony/webpack-encore');
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
Encore
.setOutputPath('./src/Resources/public/')
.setPublicPath('/bundles/template/')
.setManifestKeyPrefix('bundles/template')
.cleanupOutputBeforeBuild()
.enableSassLoader(function(sassOptions) {}, {
resolveUrlLoader: false
})
.enablePostCssLoader()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.disableSingleRuntimeChunk()
.autoProvidejQuery()
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = '3.38';
})
.addEntry('app', './assets/js/app.js')
.addStyleEntry('webfont', './assets/css/webfont.scss')
.copyFiles({
from: './assets/images',
to: 'images/[path][name].[hash:8].[ext]'
})
.copyFiles({
from: './node_modules/@typo3/icons/dist',
pattern: /\.(svg|json)$/,
to: 'icons/[path][name].[hash:8].[ext]'
})
;
module.exports = Encore.getWebpackConfig();