-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.js
48 lines (44 loc) · 1.43 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
const Encore = require('@symfony/webpack-encore');
Encore
.setOutputPath('public/build/')
.copyFiles([
{
from: './assets/images',
to: './images/[path][name].[ext]',
},
{
from: './assets/openconext/images',
to: './images/logo/[path][name].[ext]',
}
])
.setPublicPath('/build')
.cleanupOutputBeforeBuild()
// Convert typescript files.
.enableTypeScriptLoader()
.enableLessLoader()
.addStyleEntry('global', [
'./assets/scss/application.scss',
'./vendor/surfnet/stepup-bundle/src/Resources/public/less/stepup.less'
])
.addEntry('registration-print', './assets/typescript/registration-print.ts')
.addEntry('app', [
'./assets/typescript/app.ts',
'./vendor/surfnet/stepup-bundle/src/Resources/public/js/stepup.js'
])
// Convert sass files.
.enableSassLoader(function (options) {
options.sassOptions = {
outputStyle: 'expanded',
includePaths: ['public'],
};
})
.addLoader({test: /\.scss$/, loader: 'webpack-import-glob-loader'})
.configureLoaderRule('eslint', loaderRule => {
loaderRule.test = /\.(jsx?|vue)$/
})
.enableSingleRuntimeChunk()
.enableSourceMaps(!Encore.isProduction())
// enables hashed filenames (e.g. app.abc123.css)
.enableVersioning(Encore.isProduction())
;
module.exports = Encore.getWebpackConfig();