webpack.config.js   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 35
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 27
c 0
b 0
f 0
dl 0
loc 35
rs 10
mnd 1
bc 1
fnc 2
bpm 0.5
cpm 1.5
noi 0
1
const Encore = require('@symfony/webpack-encore');
2
3
if (!Encore.isRuntimeEnvironmentConfigured()) {
4
    Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
5
}
6
7
Encore
8
    .setOutputPath('public/build/')
9
    .setPublicPath('/build')
10
    .addEntry('app', './assets/js/app.js')
11
    .addEntry('homepage', './assets/js/pages/homepage.js')
12
    .addEntry('properties', './assets/js/pages/properties.js')
13
    .splitEntryChunks()
14
    .enableSingleRuntimeChunk()
15
    .cleanupOutputBeforeBuild()
16
    .enableBuildNotifications()
17
    .enableSourceMaps(!Encore.isProduction())
18
    .enableVersioning(Encore.isProduction())
19
    .configureBabel((config) => {
20
        config.plugins.push('@babel/plugin-proposal-class-properties');
21
    })
22
    .configureBabelPresetEnv((config) => {
23
        config.useBuiltIns = 'usage';
24
        config.corejs = 3;
25
    })
26
    .enableSassLoader()
27
    .copyFiles({
28
        from: './assets/images',
29
        to: 'images/[path][name].[hash:8].[ext]'
30
    })
31
    .enableIntegrityHashes(Encore.isProduction())
32
    .autoProvidejQuery()
33
;
34
35
module.exports = Encore.getWebpackConfig();
36