You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
justact/demos/justact-test/webpack.config.js

45 lines
940 B

import * as url from 'url';
const __filename = url.fileURLToPath(import.meta.url);
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
// const HtmlWebpackPlugin = require("html-webpack-plugin");
import HtmlWebpackPlugin from 'html-webpack-plugin';
const config = {
entry: "./src/index.jsx",
mode: "development",
output: {
path: `${__dirname}/build`,
filename: "bundle.js",
},
plugins: [
new HtmlWebpackPlugin({
template: "index.html",
}),
],
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
plugins: [
[
'@babel/plugin-transform-react-jsx',
{
"pragma": "justact.createElement"
}
]
]
}
}
}
]
}
};
export default config;