-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use babel-plugin-transform-regex to transfrom regex at build
- Loading branch information
David Odenwald
committed
Sep 29, 2024
1 parent
b2a7d93
commit 2105b51
Showing
7 changed files
with
706 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }, | ||
], | ||
], | ||
}; |
Oops, something went wrong.