Passed
Push — master ( c4afc2...9cde23 )
by Pieter van der
27:49 queued 12:42
created

webpack.config.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 38
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 25
dl 0
loc 38
rs 10
c 0
b 0
f 0
wmc 2
mnd 0
bc 0
fnc 2
bpm 0
cpm 1
noi 0
1
var Encore = require('@symfony/webpack-encore');
2
3
Encore
4
    .setOutputPath('public/build/')
5
    .setPublicPath('/build')
6
    .cleanupOutputBeforeBuild()
7
    // Convert typescript files.
8
    .enableTypeScriptLoader()
9
    .enableLessLoader()
10
    .addStyleEntry('global', [
11
        './public/scss/application.scss',
12
        './vendor/surfnet/stepup-bundle/src/Resources/public/less/stepup.less'
13
    ])
14
    .addEntry('registration-print', './public/typescript/registration-print.ts')
15
    .addEntry('app', [
16
        './public/typescript/app.ts',
17
        './vendor/surfnet/stepup-bundle/src/Resources/public/js/stepup.js'
18
    ])
19
20
    // Convert sass files.
21
    .enableSassLoader(function (options) {
22
        options.sassOptions = {
23
            outputStyle: 'expanded',
24
            includePaths: ['public'],
25
        };
26
    })
27
    .addLoader({test: /\.scss$/, loader: 'webpack-import-glob-loader'})
28
    .configureLoaderRule('eslint', loaderRule => {
29
        loaderRule.test = /\.(jsx?|vue)$/
30
    })
31
    .enableSingleRuntimeChunk()
32
    .enableSourceMaps(!Encore.isProduction())
33
    // enables hashed filenames (e.g. app.abc123.css)
34
    .enableVersioning(Encore.isProduction())
35
;
36
37
38
module.exports = Encore.getWebpackConfig();
39