[Vuejs]-Conditional Import external package with ESLint

0πŸ‘

βœ…

ES6 Modules are static. This means that import/export can not appear inside functions, conditional statements or contain variables. import/export statements are designed to be statically analyzable, so if you conditionally want to import something, that requires running logic and thus it cannot be parsed without running the application.

More info about it https://exploringjs.com/es6/ch_modules.html#static-module-structure

Leave a comment