2023-06-28 11:41:06 +08:00
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
module.exports = {
|
2023-07-12 11:56:31 +08:00
|
|
|
entry: {
|
2023-07-12 13:16:44 +08:00
|
|
|
shop: './static/js/shop.jsx'
|
2023-07-12 11:56:31 +08:00
|
|
|
},
|
2023-06-28 11:41:06 +08:00
|
|
|
output: {
|
2023-07-12 11:56:31 +08:00
|
|
|
path: path.resolve(__dirname, './static/js'),
|
|
|
|
filename: '[name].bundle.js'
|
2023-06-28 11:41:06 +08:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
2023-07-12 13:16:44 +08:00
|
|
|
test: /\.(js|jsx)$/,
|
2023-06-28 11:41:06 +08:00
|
|
|
exclude: /node_modules/,
|
2023-12-14 16:29:32 +08:00
|
|
|
use: [
|
|
|
|
'babel-loader',
|
|
|
|
{
|
|
|
|
loader: "webpack-preprocessor-loader",
|
|
|
|
options: {
|
|
|
|
debug: false,
|
|
|
|
directives: {
|
2023-12-15 13:49:54 +08:00
|
|
|
render_count: false,
|
2024-01-02 17:35:09 +08:00
|
|
|
options_log: false
|
2023-12-14 16:29:32 +08:00
|
|
|
},
|
|
|
|
params: {
|
|
|
|
ENV: process.env.NODE_ENV,
|
2024-01-02 17:35:09 +08:00
|
|
|
disable_card_highlight: false
|
2023-12-14 16:29:32 +08:00
|
|
|
},
|
|
|
|
verbose: false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2023-06-28 11:41:06 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2023-12-12 18:21:09 +08:00
|
|
|
resolve: {
|
|
|
|
extensions: ['.tsx', '.ts', '.js', '.jsx'],
|
2024-01-09 12:58:45 +08:00
|
|
|
"alias": {
|
|
|
|
"react": "preact/compat",
|
|
|
|
"react-dom/test-utils": "preact/test-utils",
|
|
|
|
"react-dom": "preact/compat", // Must be below test-utils
|
|
|
|
"react/jsx-runtime": "preact/jsx-runtime"
|
|
|
|
},
|
2023-12-12 18:21:09 +08:00
|
|
|
},
|
2024-01-05 17:22:53 +08:00
|
|
|
//devtool: "inline-source-map",
|
|
|
|
//mode: "development"
|
|
|
|
devtool: false,
|
|
|
|
mode: "production"
|
2023-06-28 11:41:06 +08:00
|
|
|
};
|