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 = {
|
2023-09-07 05:58:18 +08:00
|
|
|
entry: './src/editor/main.ts',
|
2023-02-11 08:53:27 +08:00
|
|
|
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: [
|
2023-02-23 02:45:50 +08:00
|
|
|
{
|
2023-03-02 04:19:15 +08:00
|
|
|
test: /\.worker.ts$/,
|
|
|
|
use: [
|
|
|
|
'worker-loader',
|
|
|
|
'ts-loader',
|
|
|
|
],
|
2023-02-23 02:45:50 +08:00
|
|
|
},
|
2023-02-11 08:53:27 +08:00
|
|
|
{
|
|
|
|
test: /\.css$/i,
|
|
|
|
use: ['style-loader', 'css-loader'],
|
2023-02-23 02:45:50 +08:00
|
|
|
exclude: /node_modules/,
|
2023-02-11 08:53:27 +08:00
|
|
|
},
|
|
|
|
{
|
2023-02-23 02:45:50 +08:00
|
|
|
test: /\.vs|fs|atlas$/,
|
2023-02-11 08:53:27 +08:00
|
|
|
use: 'raw-loader',
|
2023-02-23 02:45:50 +08:00
|
|
|
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',
|
2023-02-23 02:45:50 +08:00
|
|
|
exclude: /node_modules/,
|
2023-02-12 05:29:36 +08:00
|
|
|
},
|
2023-02-11 08:53:27 +08:00
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
use: 'ts-loader',
|
2023-03-28 00:45:56 +08:00
|
|
|
exclude: /node_modules/,
|
2023-02-11 08:53:27 +08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.tsx', '.ts', '.js'],
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
filename: 'bundle.js',
|
|
|
|
path: path.resolve(__dirname, './webpack'),
|
|
|
|
},
|
|
|
|
};
|