1
Fork 0
mirror of https://github.com/Steffo99/unisteffo.git synced 2024-11-22 16:04:21 +00:00
triennale-appunti-steffo/preact.config.js

47 lines
1.2 KiB
JavaScript
Raw Normal View History

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:28:42 +00:00
include: '.',
ignoreFile: ".gitignore",
2020-05-28 01:08:26 +00:00
configFile: '.sentryclirc',
2020-05-28 13:44:10 +00:00
stripPrefix: ["/docs"],
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
};