module.exports = {
entry: slsw.lib.entries,
target: 'node',
mode: process.env.NODE_ENV === 'development' ? 'development' : 'production',
// Necessary for __dirname and __filename to work correctly when bundling with Webpack for the dev environment.
// XXX See https://github.com/webpack/webpack/issues/1599
node: {
__dirname: true,
__filename: true,
// fs: 'empty',
// module: "empty",
},
plugins,
// Generate sourcemaps for proper error messages
devtool: 'source-map',
// We use webpack-node-externals to excludes all node deps. (like aws-sdk)
// You can manually set the externals too.
externals: [nodeExternals()],
// Run babel on all .js files and skip those in node_modules
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
include: __dirname,
exclude: /node_modules/,
},
],
},
};
I'm submitting a bug report
Webpack Version: 4.35.2
Babel Core Version: "@babel/core": "7.5.0"
Babel Loader Version: "babel-loader": "8.0.6"
Please tell us about your environment: OSX 10.x
Current behavior: Compilation fails at runtime
.babelrc
webpack.config.js
Dependencies:
It's very hard to update babel/webpack between versions, so many changes in versions with so little understanding of what happens behind those.