[proposal]: Mark all node_modules
dependencies as external
#27
Labels
issue: enhancement
Issue suggesting an enhancement to an existing feature
A clear and concise description of what the feature is
Mark all
node_modules
dependencies as external to avoid code duplication.Why should this feature be included?
When developers create plugins within the Strapi application repository, there can be a case when new dependencies are added in the project root, but they are used in both, the application and plugin, and on build the dependency code will be duplicated.
Also, a plugin is only consumed by a Strapi application, so it should not care what
node_modules
dependencies should be bundled or not, that is Strapi responsibility.Please provide an example for how this would work
I made this a video to provide a better explanation.
https://youtu.be/WxyGLWjZ2Qs
Another real example of the problem
https://youtu.be/hF74HFJ0K1s
Another solution would be with ESLint to disallow any imports outside the plugin folder.
https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
For now I solved it with ESLint plugin, found 3 dependencies that were bundled with the plugin. This should also increase build speed.
PS: I'm not sure if this is more an issue for
sdk-plugin
orpack-up
The text was updated successfully, but these errors were encountered: