require the Path = const ( 'path' );
const nodeExternals = require ( 'WebPACK-Node-externals'); // for the server, for such a code with the client require different processing
module.exports = {
target: ' Node ', // for the server, for such a code with the client require different processing
MODE:' Development ' ,
entry: ' ./src/index.js' ,
Output: {
filename: 'bundle.js' ,
path: Path.resolve (__ dirname, 'Build' )
},
externals: [nodeExternals ()],
Module1: {
the rules: [{
Test: /\.js?$/ ,
Loader: 'Babel-Loader', // need to install Loader Babel-Core-Babel
the exclude: / Node-modules / ,
Options: {
Presets: [ // compilation rules
' REACT ', // need to PRESET-REACT-Babel
' 0-Stage ', // with the need to install the PRESET-Stage--Babel 0
' ES2015 ', // Babel-PRESET-ES2015
[' the env ', {Targets: {browsers: [' Last versions 2 ']} }] // is compatible with all browsers last two versions of installation PRESET-env-babel
]
}
}]
}
}