Skip to content
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

fix: ignore babelrc #2766

Merged
merged 1 commit into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/playground/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@
},
"devDependencies": {
"@vitejs/plugin-react-refresh": "^1.3.1"
},
"babel": {
"presets": [
"@babel/preset-env"
]
}
}
1 change: 1 addition & 0 deletions packages/plugin-react-refresh/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function reactRefreshPlugin(opts) {

const isReasonReact = id.endsWith('.bs.js')
const result = transformSync(code, {
babelrc: false,
configFile: false,
filename: id,
parserOpts: {
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-vue-jsx/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function vueJsxPlugin(options = {}) {
}

const result = babel.transformSync(code, {
babelrc: false,
Comment on lines 84 to +85
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this actually need to be specified explicitly for plugin-vue-jsx? Babel docs suggests that babelrc only defaults to true if we provide a filename like in plugin-react-refresh, and false otherwise.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the same opinion
My idea: we should add a comment referencing a newly created issue to track it for later
Or just a TODO or FIXME or so

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think babelrc's default value being dependent on another option is a footgun, so it's good to be explicit here - just in case we need filename to be passed here in the future.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yyx990803 hi, @vitejs/plugin-react-refresh haven't upgraded yet?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do the release later today

ast: true,
plugins,
sourceMaps: needSourceMap,
Expand Down