30 lines
628 B
JavaScript
30 lines
628 B
JavaScript
const path = require('path');
|
|
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin")
|
|
const nodeExternals = require('webpack-node-externals');
|
|
|
|
module.exports = {
|
|
mode: 'production',
|
|
entry: './src/app.ts',
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.tsx?$/,
|
|
use: 'ts-loader',
|
|
exclude: /node_modules/,
|
|
},
|
|
],
|
|
}, node: {
|
|
__dirname: false
|
|
},
|
|
resolve: {
|
|
extensions: ['.tsx', '.ts', '.js'],
|
|
},
|
|
output: {
|
|
filename: 'app.js',
|
|
path: path.resolve(__dirname, './dist'),
|
|
},
|
|
plugins: [
|
|
new NodePolyfillPlugin(),
|
|
],
|
|
externals: [nodeExternals()],
|
|
}; |