Skip to content

Commit

Permalink
use generatorOpts.shouldPrintComment
Browse files Browse the repository at this point in the history
  • Loading branch information
mrm007 committed Jan 9, 2024
1 parent 45f688d commit 42a83a2
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 49 deletions.
49 changes: 0 additions & 49 deletions .babelrc

This file was deleted.

48 changes: 48 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
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 42a83a2

Please sign in to comment.