Skip to content

Instantly share code, notes, and snippets.

@oleh-zaporozhets
Created April 5, 2020 11:50
Show Gist options
  • Save oleh-zaporozhets/6ce45c0a5cec8b87c887f71b26ac66f8 to your computer and use it in GitHub Desktop.
Save oleh-zaporozhets/6ce45c0a5cec8b87c887f71b26ac66f8 to your computer and use it in GitHub Desktop.
Webpack for aliases
const path = require('path');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
module.exports = {
mode: process.env.NODE_ENV,
devtool: 'none',
target: 'node',
context: path.resolve(__dirname, 'src'),
entry: 'index.ts',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'build'),
publicPath: 'build',
},
resolve: {
plugins: [new TsconfigPathsPlugin()],
extensions: ['.ts', '.js'],
},
module: {
rules: [{ test: /\.ts?$/, loader: 'ts-loader' }],
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment