-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathwebpack.config.js
29 lines (27 loc) · 1.01 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
const Encore = require('@symfony/webpack-encore');
Encore.setOutputPath('public/build/')
.setPublicPath('/build')
.copyFiles([
{
from: './assets/img',
to: 'img/[name].[contenthash].[ext]',
pattern: /\.(png|jpg|jpeg|gif|ico)$/
},
{ from: './assets/img', to: 'svg/[name].svg', pattern: /\.svg$/ },
{ from: './assets/fonts', to: 'fonts/[name].[contenthash].[ext]', pattern: /\.(woff|woff2)$/ }
])
.enableSingleRuntimeChunk()
.cleanupOutputBeforeBuild(options => {
options.keep = '.gitignore';
})
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.enableTypeScriptLoader()
.enablePostCssLoader()
.enableBuildCache({ config: [__filename] })
.addEntry('app', './assets/js/app.ts')
.addEntry('form', './assets/js/form.ts')
.addStyleEntry('styles', './assets/css/styles.css')
.addStyleEntry('globals', './assets/css/globals.css')
.addStyleEntry('crp.default', './assets/css/crp.default.css');
module.exports = Encore.getWebpackConfig();