ES6 errors when bundling (jspm) a React/jsx app
Ad
I'm trying to setup a project using jspm. I've follows this great tutorial and it works pretty good, except when I try to bundle
$> jspm bundle-sfx app.jsx! app.js --skip-source-maps --minify
Building the single-file sfx bundle for app.jsx!...
err MultipleErrors: cartItem.jsx:5:22: Unexpected token =
cartItem.jsx:6:21: Unexpected token .
cartItem.jsx:6:22: Unexpected token PropTypes
cartItem.jsx:6:31: Unexpected token .
cartItem.jsx:7:14: Semi-colon expected
cartItem.jsx:7:14: Unexpected token :
(app.jsx, cartItem.jsx, and github project)
I get the impression that the bundle tool doesn't understand es6, right?
Any suggestions what I'm doing wrong here?
Also, what does the !
mean following the filename app.jsx
?
Ad
Answer
Ad
I have test the following steps and it works fine:
By the way, my jspm version is 0.16.12
by jspm -v
.
$ git clone https://github.com/egor-smirnov/egorsmirnov.me-examples.git
$ cd egorsmirnov.me-examples/react-and-es6-part-5/
$ jspm init
$ jspm install
$ jspm bundle-sfx app.jsx! app.js --skip-source-maps --minify
Ad
source: stackoverflow.com
Related Questions
Ad
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → DropzoneJS & Laravel - Output form validation errors
- → Import statement and Babel
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM
Ad