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

vue extension file with jsx #180

Open
githubtuxedo opened this issue Feb 3, 2021 · 3 comments
Open

vue extension file with jsx #180

githubtuxedo opened this issue Feb 3, 2021 · 3 comments

Comments

@githubtuxedo
Copy link

.babelrc

{
  "presets": [
    // "@babel/preset-react",
    "@vue/babel-preset-jsx",
    ["@babel/preset-env"],
  ],
  "plugins": ["@babel/plugin-transform-runtime"],
  // "plugins": ["transform-vue-jsx", "transform-runtime"],
  "env": {
    "test": {
      "presets": ["@babel/preset-env"],
      "plugins": ["transform-es2015-modules-commonjs", "dynamic-import-node"]
    }
  }
}

.vue file

<template></template>
...
<script>
   method: {
      func(h, { node, data, store }): { return <span>test</span> }
   }
</script>

Err msg: Support for the experimental syntax 'jsx' isn't currently enabled

@githubtuxedo
Copy link
Author

.package.json

"vue-loader": "^15.0.10",
"webpack": "^4.46.0",
		"@babel/plugin-syntax-jsx": "^7.0.0",
		"@babel/polyfill": "^7.12.1",

		"@babel/core": "^7.12.13",
		"@babel/plugin-proposal-class-properties": "^7.0.0",
		"@babel/plugin-proposal-decorators": "^7.0.0",
		"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
		"@babel/plugin-proposal-function-sent": "^7.0.0",
		"@babel/plugin-proposal-json-strings": "^7.0.0",
		"@babel/plugin-proposal-numeric-separator": "^7.0.0",
		"@babel/plugin-proposal-throw-expressions": "^7.0.0",
		"@babel/plugin-syntax-dynamic-import": "^7.0.0",
		"@babel/plugin-syntax-import-meta": "^7.0.0",
		"@babel/plugin-transform-modules-commonjs": "^7.0.0",
		"@babel/plugin-transform-runtime": "^7.0.0",
		"@babel/preset-env": "^7.0.0",
		"@babel/preset-react": "^7.12.13",
		"@babel/register": "^7.0.0",

@ablikim915
Copy link

ablikim915 commented Dec 6, 2021

Err msg: Support for the experimental syntax 'jsx' isn't currently enabled

I have same issue

@baixiaoji
Copy link

I have same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants