wip: webpack integration

This commit is contained in:
Tienson Qin
2025-03-10 15:05:19 +08:00
parent 1c46e0205e
commit 5632c29ba0
8 changed files with 890 additions and 24 deletions

29
webpack.config.js Normal file
View File

@@ -0,0 +1,29 @@
const path = require('path');
const webpack = require('webpack');
module.exports = {
mode: "development",
entry: './target/index.js',
output: {
path: path.resolve(__dirname, 'static/js/libs'),
filename: 'bundle.js',
clean: true,
},
module: {
rules: [
{
// docs: https://webpack.js.org/configuration/module/#resolvefullyspecified
test: /\.m?js/,
resolve: {
fullySpecified: false,
}
}
]
},
plugins: [
// fix "process is not defined" error:
new webpack.ProvidePlugin({
process: 'process/browser',
}),
],
};