poster-design/screenshot/webpack.config.js
2024-03-11 01:53:55 +08:00

45 lines
1.1 KiB
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');
const buildPlugin = require('./webpack.plugin.js');
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()],
plugins: [ new buildPlugin() ]
}