Add backend
This commit is contained in:
parent
4ad60813c9
commit
0f0a1eaf67
19 changed files with 355 additions and 45 deletions
75
backend/webpack.config.js
Normal file
75
backend/webpack.config.js
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
const path = require('path');
|
||||
const TerserJSPlugin = require('terser-webpack-plugin');
|
||||
const nodeExternals = require('webpack-node-externals');
|
||||
|
||||
const PATHS = {
|
||||
entryPoint: path.resolve(__dirname, 'src/main.ts'),
|
||||
bundles: path.resolve(__dirname, 'dist'),
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
main: [PATHS.entryPoint],
|
||||
},
|
||||
externals: [nodeExternals()],
|
||||
target: 'node',
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: PATHS.bundles,
|
||||
},
|
||||
devtool: 'source-map',
|
||||
watchOptions: {
|
||||
aggregateTimeout: 600,
|
||||
ignored: /node_modules/,
|
||||
},
|
||||
optimization: {
|
||||
minimize: true,
|
||||
usedExports: true,
|
||||
minimizer: [
|
||||
new TerserJSPlugin({
|
||||
sourceMap: true,
|
||||
cache: true,
|
||||
test: /\.ts$/i,
|
||||
terserOptions: {
|
||||
ecma: 5,
|
||||
warnings: true,
|
||||
parse: {},
|
||||
compress: { defaults: true },
|
||||
mangle: true,
|
||||
module: false,
|
||||
output: null,
|
||||
toplevel: true,
|
||||
nameCache: null,
|
||||
ie8: false,
|
||||
keep_classnames: false,
|
||||
keep_fnames: false,
|
||||
safari10: false,
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.html$/i,
|
||||
use: {
|
||||
loader: 'file-loader',
|
||||
query: {
|
||||
outputPath: '/',
|
||||
name: '[name].[ext]',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.ts$/,
|
||||
use: {
|
||||
loader: 'ts-loader',
|
||||
},
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js'],
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue