You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.5 KiB
JavaScript
54 lines
1.5 KiB
JavaScript
const path = require('path');
|
|
const webpack = require("webpack");
|
|
|
|
module.exports = {
|
|
entry: './src/index.js',
|
|
mode: 'development',
|
|
output: {
|
|
path: path.resolve(__dirname, 'public/js/dist'),
|
|
filename: 'bundle.js'
|
|
},
|
|
plugins: [
|
|
new webpack.ProvidePlugin({
|
|
React: 'react'
|
|
})
|
|
],
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.m?js$/,
|
|
exclude: /(node_modules|bower_components)/,
|
|
use: {
|
|
loader: 'babel-loader',
|
|
options: {
|
|
presets: [["@babel/preset-env", {
|
|
"targets": {
|
|
"browsers": ["last 2 versions"]
|
|
},
|
|
exclude: ['transform-regenerator'],
|
|
modules: false
|
|
}]],
|
|
plugins: [
|
|
"@babel/plugin-transform-react-jsx",
|
|
'@babel/plugin-proposal-class-properties',
|
|
'@babel/plugin-transform-runtime'
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
test: /\.js$/,
|
|
use: ["source-map-loader"],
|
|
enforce: "pre"
|
|
}
|
|
]
|
|
},
|
|
"resolve": {
|
|
"alias": {
|
|
"react": "preact/compat",
|
|
"react-dom/test-utils": "preact/test-utils",
|
|
"react-dom": "preact/compat",
|
|
},
|
|
}
|
|
};
|