Passed
Push — feature/symfony6-upgrade ( 1e55b7...4bc027 )
by Paul
12:53 queued 06:42
created

webpack.config.js (2 issues)

1
const Encore = require('@symfony/webpack-encore');
2
3
Encore
4
    .setOutputPath('public/build/')
5
    .copyFiles({
6
        from: './assets/openconext/images',
7
        to: './images/[path][name].[ext]',
8
    })
9
    .setPublicPath('/build')
10
    .cleanupOutputBeforeBuild()
11
    // Convert typescript files.
12
    .enableTypeScriptLoader()
13
    .enableLessLoader()
14
    .addStyleEntry('global', [
15
        './assets/scss/application.scss',
16
        './vendor/surfnet/stepup-bundle/src/Resources/public/less/stepup.less'
17
    ])
18
    .addEntry('registration-print', './assets/typescript/registration-print.ts')
19
    .addEntry('app', [
20
        './assets/typescript/app.ts',
21
        './vendor/surfnet/stepup-bundle/src/Resources/public/js/stepup.js'
22
    ])
23
24
    // Convert sass files.
25
    .enableSassLoader(function (options) {
26
        options.sassOptions = {
27
            outputStyle: 'expanded',
28
            includePaths: ['public'],
29
        };
30
    })
31
    .addLoader({test: /\.scss$/, loader: 'webpack-import-glob-loader'})
32
    .configureLoaderRule('eslint', loaderRule => {
0 ignored issues
show
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
33
        loaderRule.test = /\.(jsx?|vue)$/
34
    })
0 ignored issues
show
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
35
    .enableSingleRuntimeChunk()
36
    .enableSourceMaps(!Encore.isProduction())
37
    // enables hashed filenames (e.g. app.abc123.css)
38
    .enableVersioning(Encore.isProduction())
39
;
40
41
42
module.exports = Encore.getWebpackConfig();
43