-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathwebpack.config.js
More file actions
49 lines (45 loc) · 1.5 KB
/
webpack.config.js
File metadata and controls
49 lines (45 loc) · 1.5 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
40
41
42
43
44
45
46
47
48
49
const Encore = require('@symfony/webpack-encore');
const ESLintPlugin = require('eslint-webpack-plugin');
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', enforce: 'pre'})
.addPlugin(new ESLintPlugin({
extensions: ['js', 'jsx', 'ts', 'tsx', 'vue'],
}))
.enableSingleRuntimeChunk()
.enableSourceMaps(!Encore.isProduction())
// enables hashed filenames (e.g. app.abc123.css)
.enableVersioning(Encore.isProduction())
;
module.exports = Encore.getWebpackConfig();