-
Notifications
You must be signed in to change notification settings - Fork 321
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
Error while parsing es6 import syntax #18
Comments
You have two options. You can either use |
Hi I have tried the above but Im still getting the same issue. thanks |
The problem is that your test doesn't match |
That worked. Thanks for your help |
No probs. I updated the book to include that I'm currently working on a project based Webpack book over at https://leanpub.com/survivejs_webpack btw. Still a bit early days with that but feedback could be welcome. |
Just a question, where does the harmony flag go? do I need to put it in the html?(can this be avoided?) or in the webpack.config.js?(and where in the config?) |
@zenith-matic |
yup I knew that, I was just in desperation mode trying everything to get the es6 modules to play nice with webpack. I somehow managed to fix things. |
Hi
In my main.s js I am using the import syntax
import './Component.jsx';
When I run 'npm run dev' I get the following error:
ERROR in ./app/main.js
Module parse failed: /Users/aoshi_1/Desktop/test_webpack/app/main.js Line 2: Unexpected reserved word
You may need an appropriate loader to handle this file type.
| 'use strict';
| import './Component.jsx';
|
|
This is my config setup
var path = require('path');
var config = {
entry: path.resolve(__dirname, 'app/main.js'),
output: {
path: path.resolve(__dirname, 'build'),
filename: 'bundle.js'
},
module: {
loaders: [{
test: /.jsx$/, // A regexp to test the require path
loader: 'jsx' // The module to load. "jsx" is short for "jsx-loader"
}]
}
};
module.exports = config;
thanks
The text was updated successfully, but these errors were encountered: