2020-05-28 01:08:26 +00:00
|
|
|
import SentryCliPlugin from "@sentry/webpack-plugin";
|
|
|
|
const DefinePlugin = require("webpack/lib/DefinePlugin");
|
|
|
|
|
|
|
|
|
2020-03-01 20:25:46 +00:00
|
|
|
export default function (config, env, helpers) {
|
|
|
|
// noinspection JSUnresolvedVariable
|
|
|
|
config.resolve.alias["react"] = "preact/compat";
|
|
|
|
// noinspection JSUnresolvedVariable
|
|
|
|
config.resolve.alias["react-dom"] = "preact/compat";
|
|
|
|
|
|
|
|
config.module.rules.push(
|
|
|
|
{
|
|
|
|
test: /\.nojekyll$/,
|
|
|
|
loader: 'file-loader',
|
|
|
|
options: {
|
|
|
|
name: '.nojekyll'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
config.module.rules.push(
|
|
|
|
{
|
|
|
|
test: /CNAME$/,
|
|
|
|
loader: 'file-loader',
|
|
|
|
options: {
|
|
|
|
name: 'CNAME'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
2020-05-28 01:08:26 +00:00
|
|
|
|
|
|
|
config.plugins.push(
|
2020-05-28 12:53:38 +00:00
|
|
|
new DefinePlugin({"process.env.RELEASE": `"${process.env.npm_package_version}"`})
|
2020-05-28 01:08:26 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
if(env.production) {
|
|
|
|
config.plugins.push(
|
|
|
|
new SentryCliPlugin({
|
2020-05-28 13:19:33 +00:00
|
|
|
include: './src',
|
2020-05-28 01:08:26 +00:00
|
|
|
rewrite: true,
|
|
|
|
ignore: ['node_modules'],
|
|
|
|
configFile: '.sentryclirc',
|
2020-05-28 12:53:38 +00:00
|
|
|
release: process.env.npm_package_version,
|
2020-05-28 01:08:26 +00:00
|
|
|
})
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2020-03-01 20:25:46 +00:00
|
|
|
};
|