I'm trying to develop an npm library, but when I use it in another app, e.g.:
import React from 'react';
import SmallGrid from 'react-smallgrid';
export default class Library extends React.Component{
I get the following error:
$ grunt browserify
Running "browserify:jsx" (browserify) task
>> /Users/me/code/myapp/node_modules/react-smallgrid/src/smallgrid.jsx:1
>> import React from 'react';
>> ^
>> ParseError: 'import' and 'export' may appear only with 'sourceType: module'
Warning: Error running grunt-browserify. Use --force to continue.
The library starts with:
import React from 'react';
import _ from 'lodash';
export default class SmallGrid extends React.Component{
Is there anybody here that knows what these horrible javascript errors mean?