-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable requiring sub-dependencies #111
Comments
I like the idea, it should be pretty easy to imlement as a separate plugin, something like this: webCompiler.hooks.normalModuleFactory.tap(p, normalModuleFactory => {
const importedPackages = { ...getFromPackage(), ...getFromBuildTool() }
normalModuleFactory.hooks.afterResolve.tap(p, data => {
if (isLibraryRequest(data) && !importedPackages[data.rawRequest])
throw new Error('...')
return data
})
}) |
This is actually more tricky than it sounds for stuff where we import a specific file. It's for example ok to import https://github.com/webpack/enhanced-resolve/tree/v4.0.0 is a tricky library. We could do some manual string splitting, but there might be a chance that the library already provides some information. |
It still allows us to import dependencies that are specifically for the server (like express). |
Oh and this is blocked by #113 |
It would also cause problems with the @kaliber/build. We don't want people to add The same goes for the The complexity that is introduced when adding these edge cases is not worth the benefit. On top of that, we don't have enough examples where this caused a problem. |
It's possible to import every package inside the
node_modules
directory. This may lead to bugs when for example in the future a package removes a dependency which was accidentally imported by the app itself without explicitly installing it.The text was updated successfully, but these errors were encountered: