Ensure import()
ed dependencies are always dynamically imported
#208
Labels
import()
ed dependencies are always dynamically imported
#208
If you first
import('react')
and thenimport "react"
in the same bundle, Webpack will not create a secondary chunk, it will just inline it.In a large application, it's not easy to keep track of all the import decisions, so one optimization (deferred loading via
import()
) can be undone and left unnoticed forever.We can now enforce that some dependencies are always dynamically imported:
canvas-confetti
viaimport()
)import("new-dependency")
Both of these are enforceable via
no-restricted-syntax
Related
import "react"
vsimport("react")
) import-js/eslint-plugin-import#2326 (comment)The text was updated successfully, but these errors were encountered: