1
Fork 0
mirror of https://github.com/Steffo99/unisteffo.git synced 2024-11-29 11:24:18 +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({
include: './docs',
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
};