Passed
Push — master ( 2b7bb3...0db2dd )
by Clint A
06:52
created

webpack.config.js ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
var Encore = require('@symfony/webpack-encore')
2
3
Encore
4
  // the project directory where all compiled assets will be stored
5
  .setOutputPath('public/build/')
6
7
  // the public path used by the web server to access the previous directory
8
  .setPublicPath('/build')
9
10
  // will create public/build/app.js and public/build/app.css
11
  .addEntry('app', './assets/app.js')
12
  .addEntry('polyfill', './assets/polyfill.js')
13
  .addEntry('total-selected-charges', './assets/total-selected-charges.js')
14
  .addEntry('alert', './assets/alert.js')
15
16
  .configureBabel(babelConfig => {
17
    babelConfig.presets.push('stage-0')
18
    babelConfig.presets.push('react')
19
  })
20
21
  .enablePostCssLoader()
22
23
  // enable source maps during development
24
  .enableSourceMaps(!Encore.isProduction())
25
26
  // empty the outputPath dir before each build
27
  .cleanupOutputBeforeBuild()
28
29
  // show OS notifications when builds finish/fail
30
  .enableBuildNotifications()
31
32
// export the final configuration
33
module.exports = Encore.getWebpackConfig()
34