@@ -3,6 +3,7 @@ const nodeExternals = require('webpack-node-externals')
33const FriendlyErrorsWebpackPlugin = require ( 'friendly-errors-webpack-plugin' )
44const config = require ( './paths' )
55const path = require ( 'path' )
6+ const babelConfig = require ( '../babel' )
67
78// This is the Webpack configuration.
89// It is focused on developer experience and fast rebuilds.
@@ -74,26 +75,7 @@ module.exports = (options) => ({
7475 / n o d e _ m o d u l e s / ,
7576 config . buildPath
7677 ] ,
77- options : {
78- // babel-preset-env is like autoprefixer, but for javascript.
79- // It efficiently optimizes transpilation based on the specified
80- // target environment. As a default, we set it to target the
81- // user's currently installed Node.js version. We also turn off
82- // ES Modules, and Webpack handles that for us.
83- presets : [
84- [ require . resolve ( 'babel-preset-env' ) , {
85- target : {
86- node : 'current'
87- } ,
88- modules : false
89- } ]
90- ] ,
91- // These are the default JavaScript language addons.
92- plugins : [
93- require . resolve ( 'babel-plugin-transform-object-rest-spread' ) ,
94- require . resolve ( 'babel-plugin-transform-class-properties' )
95- ]
96- }
78+ options : babelConfig
9779 }
9880 ]
9981 } ,
@@ -115,9 +97,10 @@ module.exports = (options) => ({
11597 // The FriendlyErrorsWebpackPlugin (when combined with source-maps)
11698 // gives Backpack its human-readable error messages.
11799 new FriendlyErrorsWebpackPlugin ( ) ,
118- // This plugin is awkwardly named. It does not actually swallow errors.
119- // Instead, it just prevents Webpack from printing out compile time
120- // stats to the console.
100+ // This plugin is awkwardly named. Use to be called NoErrorsPlugin.
101+ // It does not actually swallow errors. Instead, it just prevents
102+ // Webpack from printing out compile time stats to the console.
103+ // @todo new webpack.NoEmitOnErrorsPlugin()
121104 new webpack . NoErrorsPlugin ( )
122105 ]
123106} )
0 commit comments