-
Notifications
You must be signed in to change notification settings - Fork 27
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
Not able to parse dynamic import #48
Comments
Happy to move over, I planned to move to the next major version of Acorn with the next release but will attempt to address this sooner. |
I created a local branch using Going to wait on either kesne/acorn-dynamic-import#14, or look at extracting the version used in https://github.com/standard-things/esm/blob/master/src/acorn/internal/walk.js. |
If anyone else wants to take a look at this before I have a chance to return to it, here's the branch with the progress I made. https://github.com/ampproject/rollup-plugin-closure-compiler/tree/dynamic-import |
Opened an issue on the It appears that |
Created a repo with workaround for Found another root issue preventing this from working: Each Plugin invocation creates a singluar set of transforms and applies them to source. When This means a parsed AST for one file is used to perform transformations on others. Whoops! |
Released |
@kristoferbaxter I'm getting the same error message on 0.27.0 (simple optimizations) when I try to use MobX, points to |
What's the issue?
In trying to add this package in https://github.com/MaxMilton/sapper-template-rollup/tree/feat/use-closure-compiler I ran into the issue of
import()
not able to be be parsed processed by acorn, which is used through this package.How do we reproduce the issue?
yarn install
.yarn run build
.Result:
After some debugging you'll find acorn is trying to do
baseVisitor['Import']
, which is not available in acorn at the moment.Additional context
By adding the
acorn-dynamic-import
package it's possible to support parsingimport()
. In fact this is exactly what closure-webpack-plugin is doing, as well as others like buble.One other critical part of this is support in Closure Compiler itself for parser support for dynamic import: google/closure-compiler#2770. Although, it is possible for a rollup plugin to rewrite the
import()
into something else before it ever hits Closure so this issue is not necessarily dependant upon Closure parser support.The text was updated successfully, but these errors were encountered: