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

61 lines
1.6 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-06-29 13:45:09 +00:00
const ProvidePlugin = require("webpack/lib/ProvidePlugin");
2020-05-28 01:08:26 +00:00
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";
2020-06-29 13:45:09 +00:00
// noinspection JSUnresolvedVariable
config.resolve.alias["path"] = "path-browserify";
2020-03-01 20:25:46 +00:00
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-06-29 13:45:09 +00:00
config.module.rules.push(
{
test: /favicon\.ico$/,
loader: 'file-loader',
options: {
name: 'favicon.ico'
}
}
);
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
);
2020-06-29 13:45:09 +00:00
config.plugins.push(
new ProvidePlugin({"process": "process/browser"})
);
2020-05-28 01:08:26 +00:00
if(env.production) {
config.plugins.push(
new SentryCliPlugin({
2020-05-28 14:27:17 +00:00
include: './docs',
2020-05-28 13:28:42 +00:00
ignoreFile: ".gitignore",
2020-05-28 01:08:26 +00:00
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
};