ObjToSchematic/webpack.common.js

54 lines
1.4 KiB
JavaScript
Raw Normal View History

2023-02-11 08:53:27 +08:00
const path = require('path');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
2023-03-02 02:06:13 +08:00
const HtmlWebpackPlugin = require('html-webpack-plugin');
2023-02-11 08:53:27 +08:00
module.exports = {
entry: './src/client.ts',
plugins: [
new NodePolyfillPlugin(),
2023-03-02 02:06:13 +08:00
new HtmlWebpackPlugin({
template: './template.html',
favicon: './res/static/icon.ico',
}),
2023-02-11 08:53:27 +08:00
],
module: {
rules: [
/*
{
test: /\.json$/i,
use: ['json-loader'],
exclude: /node_modules/,
},
*/
2023-02-11 08:53:27 +08:00
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
exclude: /node_modules/,
2023-02-11 08:53:27 +08:00
},
{
test: /\.vs|fs|atlas$/,
2023-02-11 08:53:27 +08:00
use: 'raw-loader',
exclude: /\.js$/,
exclude: /node_modules/,
2023-02-11 08:53:27 +08:00
},
2023-02-12 05:29:36 +08:00
{
test: /\.png$/,
use: 'file-loader',
exclude: /node_modules/,
2023-02-12 05:29:36 +08:00
},
2023-02-11 08:53:27 +08:00
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules|main\.ts/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, './webpack'),
},
};