Skip to content

Commit

Permalink
use babel-plugin-transform-regex to transfrom regex at build
Browse files Browse the repository at this point in the history
  • Loading branch information
David Odenwald committed Sep 29, 2024
1 parent b2a7d93 commit 2105b51
Show file tree
Hide file tree
Showing 7 changed files with 706 additions and 335 deletions.
11 changes: 11 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
const regexHeaderComment = `Do not edit this file!!!
The file "src/regex_editable.ts" contains the source for this regex and is transformed by "babel-plugin-transform-regex".
Run "npm run build:regex" to generate this file again afer editing the source.`;

module.exports = {
presets: ["@babel/preset-typescript"],
plugins: [
[
"babel-plugin-transform-regex",
{ removeImport: true, headerComment: regexHeaderComment },
],
],
};
Loading

0 comments on commit 2105b51

Please sign in to comment.