'Unexpected identifier and Unexpected token export when using babel standalone
I was trying using 'Babel standalone' to import module but getting Unexpected identifier and Unexpected token export, I can't figure it out why.
Importing is fine on other project which didn't use Babel, I mean vanilla JavaScript, anyway. Here is my code
<script src="dep/babel-standalone-6-min.js"></script>
<script src="dep/react.production-18.min.js"></script>
<script src="dep/react-dom.production-18.min.js"></script>
<script type="text/jsx" data-presets="react"
data-type="module" src="react/main.jsx"></script>
<script type="text/jsx" data-presets="react"
data-type="module" src="react/o-module.jsx"></script>
// main.jsx
import oModule from './o-module.jsx'
// o-module.jsx
export default () => {...}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
