I am using grunt to automate the whole process. This is what my configuration looks like:
browserify: {
dist: {
files: {
'<%= dirs.dest %>/index.js': [
'<%= dirs.src %>/index.js'
]
},
options: {
transform: [
['babelify', { presets: ['es2015', 'stage-3', 'react'] }]
]
},
}
},
It fails when attempting to parse one of the react components that are imported with the following error:
>> <div>
>> ^
>> ParseError: Unexpected token
Warning: Error running grunt-browserify. Use --force to continue.
Aborted due to warnings.
I've tried using the same file that throws the error with babel-standalone in the browser and it works just fine.
I'm stumped as to how to fix this as most links say that using babel-preset-react should fix it (and it works with another project that I have)