Skip to content

Instantly share code, notes, and snippets.

@ofcRS
Created November 13, 2019 16:27
Show Gist options
  • Select an option

  • Save ofcRS/b15f3e40a7c60233aeb8c11847a39db8 to your computer and use it in GitHub Desktop.

Select an option

Save ofcRS/b15f3e40a7c60233aeb8c11847a39db8 to your computer and use it in GitHub Desktop.
const path = require('path');
module.exports = env => {
const mode = env.production ? 'production' : 'development';
const isProd = mode === 'production';
return ({
mode,
entry: path.resolve(__dirname, 'src/testwebpack.ts'),
target: 'node',
optimization: {
minimize: false/*isProd*/,
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
},
]
},
resolve: {
extensions: ['.ts'],
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment