38 lines
961 B
JavaScript
38 lines
961 B
JavaScript
const path = require('path')
|
|
|
|
module.exports = {
|
|
entry: './src/main.js',
|
|
mode: 'development',
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist'),
|
|
filename: 'myapp.bundle.js',
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"react": "preact/compat",
|
|
"react-dom/test-utils": "preact/test-utils",
|
|
"react-dom": "preact/compat",
|
|
"react/jsx-runtime": "preact/jsx-runtime"
|
|
}
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.m?js$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: "babel-loader",
|
|
options: {
|
|
presets:["@babel/preset-env"]
|
|
}
|
|
}
|
|
}
|
|
]},
|
|
// plugins: [
|
|
// ['@babel/plugin-transform-react-jsx', {
|
|
// pragma: 'h',
|
|
// pragmaFrag: 'Fragment',
|
|
// }],
|
|
// ]
|
|
};
|