mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 11:48:41 +00:00
* Include only necessary fonts for target environment specified by Browserslist Allow WOFF and WOFF2 to be controlled using environment variables * Fix links * Fix merge error * Update dependencies * Replace uglifyjs-webpack-plugin with terser-webpack-plugin * Do not set `targets` if !isESMBuild
29 lines
540 B
JavaScript
29 lines
540 B
JavaScript
module.exports = api => {
|
|
const isESMBuild = api.env("esm");
|
|
|
|
const presets = [
|
|
["@babel/env", {
|
|
debug: true,
|
|
loose: true,
|
|
}],
|
|
"@babel/flow",
|
|
];
|
|
if (isESMBuild) {
|
|
presets[0][1].targets = {
|
|
esmodules: true,
|
|
};
|
|
}
|
|
const plugins = [
|
|
"@babel/transform-runtime",
|
|
["@babel/proposal-class-properties", {
|
|
loose: true,
|
|
}],
|
|
"version-inline",
|
|
];
|
|
|
|
return {
|
|
presets,
|
|
plugins,
|
|
};
|
|
};
|