2022-06-14 21:00:08 +00:00
|
|
|
module.exports = {
|
2022-06-15 17:52:00 +00:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.m?js$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
plugins: [
|
|
|
|
[ "@babel/plugin-transform-react-jsx", {
|
|
|
|
"pragma": "h",
|
|
|
|
"pragmaFrag": "Fragment",
|
|
|
|
} ],
|
|
|
|
"@babel/preset-react"
|
|
|
|
]
|
|
|
|
}
|
2022-06-14 21:00:08 +00:00
|
|
|
}
|
2022-06-15 17:52:00 +00:00
|
|
|
},
|
|
|
|
]
|
|
|
|
},
|
|
|
|
webpack: {
|
|
|
|
configure: {
|
|
|
|
"resolve": {
|
|
|
|
"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"
|
|
|
|
},
|
|
|
|
}
|
2022-06-14 21:00:08 +00:00
|
|
|
}
|
2022-06-15 17:52:00 +00:00
|
|
|
},
|
|
|
|
babel: {
|
|
|
|
"presets": [
|
|
|
|
"@babel/preset-env",
|
|
|
|
["@babel/preset-react", {"runtime": "automatic"}]
|
|
|
|
],
|
|
|
|
// plugins: [],
|
|
|
|
loaderOptions: (babelLoaderOptions, { env, paths }) => {
|
|
|
|
return babelLoaderOptions;
|
|
|
|
},
|
|
|
|
},
|
2022-06-14 21:00:08 +00:00
|
|
|
}
|