Skip to content

Commit

Permalink
Merge pull request #275 from mrm007/master
Browse files Browse the repository at this point in the history
Fix pure annotation warnings
  • Loading branch information
theKashey committed Jan 23, 2024
2 parents a39e66d + 08c5184 commit 38186c3
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 43 deletions.
43 changes: 0 additions & 43 deletions .babelrc

This file was deleted.

50 changes: 50 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// modified Babel's default to account for __PURE__ annotations
// https://babeljs.io/docs/options#shouldprintcomment
const shouldPrintComment = (val) => /@license|@preserve|[#@]__PURE__/.test(val);

module.exports = {
env: {
cjs: {
presets: ["@babel/preset-env", "@babel/preset-react"],
plugins: [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-runtime",
[
"transform-react-remove-prop-types",
{
mode: "wrap",
},
],
],
generatorOpts: {
shouldPrintComment,
},
},
es2015: {
presets: [
[
"@babel/preset-env",
{
modules: false,
loose: true,
},
],
"@babel/preset-react",
],
plugins: [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
["@babel/plugin-transform-runtime", { useESModules: true }],
[
"transform-react-remove-prop-types",
{
mode: "wrap",
},
],
],
generatorOpts: {
shouldPrintComment,
},
},
},
};

0 comments on commit 38186c3

Please sign in to comment.