framework7io / framework7-loader

MIT License
8 stars 7 forks source link

Dynamic import is not supported due to acorn #6

Closed alexkuc closed 4 years ago

alexkuc commented 4 years ago

Hi!

It appears that dynamic import, i.e. import(...) is not supported by this loader due to acorn not supporting it. When trying to use dynamic import, the following error is generated:

SyntaxError: Unexpected token (1:6)

To enable dynamic import, two solutions I found is acorn-dynamic-import and acorn-stage3.

Unfortunately, both solutions require version 6.x.x of acorn but currently used version by loader and F7 is 7.x.x.

I have tried forking this loader and implement a fix for this issue but I was unsuccessful.

I was getting stuck at the error:

acorn-private-class-elements does not support mixing different acorn copies

So I decided to leave this bug/message here in case someone else tries to use dynamic import and experience the same issue.

nolimits4web commented 4 years ago

Ok, thanks. Yes, i guess i need to move away from acorn to babel + babylon instead, as anyway we use babel in our projects