Deeper Babel configuration. Passing options.
Hi there!
I'm building a frontend for embedded device so working with CDN since there's no place for all required modules.
Here is the case: Vue single file component imports js file. Vue file itself is loaded using sfc-loader. This action leads to method transformJSCode and to assertModuleNodeAllowed call for js file. And it fails since it is not a module but a plain javascript.
As I can see, there's nothing passed at the Babel parser level except of additionalBabelParserPlugins.
Is there a way to pass options to parser directly? I'm very interested in allowImportExportEverywhere flag.
So the questions are:
- is it possible now to pass required Babel options?
- Are there plans to implement this feature?
Hi ru5t, you really want to use import and export from everywhere ?
Hi, Frank. For sure, in general - no. But in some particular cases in the limited and controlled context - probably. I mean that it is an exception that vue single file component is going to be loaded like this. But to have possibility to tune babel's logic deeper, if needed, would be good. This particular case was solved by rewriting of provided js library in CommonJS manner. It was small enough to do so. So, basically absence of this feature is not slowing process. But it seems to me, that deeper configuration possibilities could be of some use for someone.