-
Notifications
You must be signed in to change notification settings - Fork 212
[App Extensibility ⚙️] Fix Babel configuration ignore node_modules folder (@W-17373534@)
#2228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b9f3a7e
2230d17
0401f10
c099e68
d5de6f6
049e826
9a491a9
9e3d3b8
2f1c77b
90d0357
bf4968d
394f9b3
e60e441
64e45c7
645f65d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -340,6 +340,8 @@ const ruleForBabelLoader = (babelPlugins) => { | |
| id: 'babel-loader', | ||
| test: /(\.js(x?)|\.ts(x?))$/, | ||
| // NOTE: Because our extensions are just folders containing source code, we need to ensure that the babel-loader processes them. | ||
| // This regex exclude everything in node_modules, but node_modules/extensions-*/ folders | ||
| exclude: /node_modules\/(?!(@?[^/]+\/)?extension-)[^/]+\/.*$/i, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dumb question, we have
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are different configurations that don't work with each other. One is the Webpack configuration for babel-loader, and the other is the Babel configuration for babel-node, where we cannot use the exclude option. They are used in separate stages. |
||
| use: [ | ||
| { | ||
| loader: findDepInStack('babel-loader'), | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL you can pass a function into babel config ignore :-o. Any doc link about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's basically creating an inline Babel plugin. See https://babeljs.io/docs/plugins#plugin-development