poster-design/screenshot/webpack.config.js
ShawnPhang c25bd8b3b0 init
2023-07-18 15:03:15 +08:00

43 lines
1010 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* @Author: ShawnPhang
* @Date: 2021-12-27 10:15:07
* @Description:
* @LastEditors: ShawnPhang
* @LastEditTime: 2021-12-27 11:22:29
*/
'use strict'
const path = require('path')
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const nodeExternals = require('webpack-node-externals');
module.exports = {
mode: process.env.NODE_ENV,
target: 'node',
externals: [nodeExternals()],
entry: './src/main.ts',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'server.js',
},
module: {
rules: [
{
test: /\.tsx?$/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true,
// 指定特定的ts编译配置为了区分脚本的ts配置
configFile: path.resolve(__dirname, './tsconfig.json'),
},
},
],
exclude: /node_modules/,
},
],
},
// plugins: [new BundleAnalyzerPlugin()],
}