2020-06-24 20:24:57 +00:00
|
|
|
const DefinePlugin = require("webpack/lib/DefinePlugin");
|
|
|
|
|
|
|
|
|
2020-05-31 22:55:02 +00:00
|
|
|
export default function (config, env, helpers) {
|
2020-06-24 17:58:36 +00:00
|
|
|
config.module.rules[4].include = [env.source(".")]
|
|
|
|
config.module.rules[5].exclude = [env.source(".")]
|
|
|
|
|
2020-05-31 22:55:02 +00:00
|
|
|
// noinspection JSUnresolvedVariable
|
|
|
|
config.resolve.alias["react"] = "preact/compat";
|
|
|
|
// noinspection JSUnresolvedVariable
|
|
|
|
config.resolve.alias["react-dom"] = "preact/compat";
|
2020-06-24 20:24:57 +00:00
|
|
|
|
|
|
|
config.plugins.push(
|
|
|
|
new DefinePlugin({"process.env.RELEASE": `"${process.env.npm_package_version}"`})
|
|
|
|
);
|
2020-05-31 22:55:02 +00:00
|
|
|
};
|