shopware-cli searches for any package.json and installs the dependencies. For some package.json files it's waste of time as they only install dev dependencies, like formatter, linter, typescript compiler etc. Therefore, it makes sense to use the dependencies and devDependencies feature of the package.json file.
dependencies contains libraries which are required for the build step, no linter, formatter, type checker stuff.
everything installed of that extension is not relevant for the build result.
Solution
We have a new flag in the .shopware-extension.yml
# .shopware-extension.yml
npmStrict: true
When that is enabled, all npm install will be executed with --production flag. We check also before we execute the package manager if there is any dependency, to save time while executing the package manager.
Problem
shopware-cli
searches for anypackage.json
and installs the dependencies. For somepackage.json
files it's waste of time as they only install dev dependencies, like formatter, linter, typescript compiler etc. Therefore, it makes sense to use thedependencies
anddevDependencies
feature of the package.json file.dependencies
contains libraries which are required for the build step, no linter, formatter, type checker stuff.devDependencies
contains everything elseExample:
everything installed of that extension is not relevant for the build result.
Solution
We have a new flag in the
.shopware-extension.yml
When that is enabled, all
npm install
will be executed with--production
flag. We check also before we execute the package manager if there is any dependency, to save time while executing the package manager.