Skip to content

Instantly share code, notes, and snippets.

@marweck
Created October 9, 2018 17:41
Show Gist options
  • Save marweck/0d8022c290b18b3570dbfc89cda340df to your computer and use it in GitHub Desktop.
Save marweck/0d8022c290b18b3570dbfc89cda340df to your computer and use it in GitHub Desktop.
Webpack Configuration for Node backend app
const path = require('path');
const { ProgressPlugin } = require('webpack');
/**
* Webpack config
*/
module.exports = {
entry: './src/main.ts',
mode: 'production',
target: 'node',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
plugins: [new ProgressPlugin()],
resolve: {
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js']
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'main.js'
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment