Setup `import/no-extraneous-dependencies` eslint rule to prevent extraneous dependencies being used in modular.
steveukx opened this issue · comments
The default and more common use case for modular-scripts
is to build with Webpack, switching to esbuild
by setting the environment variable USE_MODULAR_ESBUILD
currently throws an exception due to missing dependencies.
The modular-scripts
package in the modular
monorepo references tmp
which is present in the workspace as it's a transitive dependency of the workspace dependency patch-package
, but it's not loaded in the packaged modular-scripts
.
Options for solving this include documenting the missing dependencies where they are intentionally excluded from the bundle (listing them as peerDependencies
would make them easy to find, or include them as part of a readme that documents the environment variable), or explicitly adding missing dependencies to the dependencies
section of the package.json
.
Using the import/no-extraneous-dependencies
lint rule would help ensure future releases contain references to dependencies that could otherwise be missed.