-
Notifications
You must be signed in to change notification settings - Fork 7
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
ES6 format is not working #2
Comments
You won't just be able to use ES6 in your project, you need to either compile your source into ES5 or use the babel-register require hook, and then lift via See https://github.com/teamfa/sails-universal-react-starter - it's a full ES6 project, sails, react + HMR and server side rendering of react too. You could just use the ES5 examples in the readme if you don't want to go the full ES6 route. |
I see, thank you Actually I'm building a project but using Angular 1.x so, some configurations will be useful from that react-starter. For now I'm going to use the ES5 mode in my project and I'm using a pice of code from other issue which is this one:
but the console says
I'm using that /assets/js/app because inside I have my app.js, controllers.js, etc. of angular and I have the style loaderand the path package. |
That issue is usually because a path you specified in the config is invalid. The config below is looking for a file
So change these to the correct entry file of your angular code, you should probably change the output path also otherwise this builds to the same directory - the sails grunt build normally goes to a .tmp folder in the root of the project so this is generally a good place to output to for consistency. So maybe output to Should be fairly straight forward to convert that other project to do angular, you doing your angular in ES5 or 6? I can always try make a quick starter for angular based on the react one if you're desperate 🙇 If your angular is in es6 then you'll need a babel loader in your config:
See https://github.com/preboot/angular-webpack for a angular + webpack workflow example |
Also, remove the 'development' object from your config if it's not being used, this creates a webpack dev server which you're currently not using. |
I see now, I'm trying to replicate almost all the grunt default functions and in this case I'm using CopyWebpackPlugin to copy the folder to the I'm new in webpack as you can see but I really want to create this project and release it then I'm going to create a new differente one but using react. |
For stylus you can use https://github.com/shama/stylus-loader - you need to add the loader and then the export extensions as listed on the readme, should just work straight away then. You'll need all the extensions shown, including the empty one. Can't promise a starter until later tomorrow or the day after though. 😸 |
That´s ok. Thanks! |
Hi!
I already have my .babelrc with and the npm package installed node_modules
But when I run sails lift the console is showing and error related to the import word
So I want to know what else is necessary to run the webpack config in ES6 format.
I'm using sails 0.12.2
Thanks!
The text was updated successfully, but these errors were encountered: