-
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
Feature-Request: Using with ES6 #6
Comments
Seems to me that there might be a babel setting which is messing up parsing the output from nearley. I'll investigate a bit and see if we can bake something here without needing the custom loader messing up with the source code, as I think it's a bit fragile to do so. Could you provide the exact babel config you are using? |
@peey Any solution? |
@andres-arana I got same problem When i try to use it with // one of my Webpack config rule
{
test: /\.ne$/,
use: [
{ loader: 'babel-loader', options: babelLoaderOptions },
{ loader: 'nearley-loader', options: nearleyLoaderOptions },
],
} I got a error:
import Grammar from './MyNearley.ne'; |
I am facing an issue that this loader does not further process the generated parser with babel. This means if you have post-processing functions using ES6 (arrow functions among other things) in your
.ne
file then it basically won't work in older browsers.Here's what I'm using as a temporary workaround:
Directly chaining it with
babel-loader
but it doesn't work. I had to write a custom loader to serve as an intermediary between this and babel loader.// your webpack config:
The text was updated successfully, but these errors were encountered: