Closed enigma1 closed 4 years ago
I agree that this would be good to support, however dynamic import has the entirety of JS available for constructing the path, so we'd have to decide on specific patterns to match.
Starting with non-tagged template literals with a leading non-empty literal section seems good. I'll take a stab at this later today.
Yea pattern support would be awesome :+1:
The code in your sample should work now with version 6.6.0. Feel free to open another issue if it doesn't work as you expect.
Just to say thanks, everything works as expected now.
In cases where the path is dynamically I have a bit of hard time to convert it. For example
As long as the parameters can be pre-calculated is not a problem but if they are not it can't be used. So in this example here, I can handle the second instance of import by adding an import function in the functions array of this plugin, but for the first instance direct processing is aborted because it can't simply evaluate the path.
I could handle it in the bundler it just would been good if there was a way from within the plugin to cover that case too.