-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
devDependencies installed even with --no-dev #269
Comments
this means that the packages are not installed after dependency resolution. They are still included in resolving dependencies otherwise a lock file may result in a set of package versions that is not installable when |
It does make some sense, but in context of this being plugin for Composer it doesn't make as much sense as it would for NPM. If we're using PHP instead of Node.js to install packages, there is a good chance we don't need dev packages too. What about some option, probably in |
how would you expect a |
Typically |
In other words, |
I was have similar problem with dependencies. In my quite big project it was take more than half of hour for each "composer require" or "composer update", and respectively to debug output from composer (with option -vvv), 90% of that time was spend to packages that i absolutelly no need. In my case that is not only dev dependencies, but for big part of packages i do not need regular dependencies too. It add two options under config.fxp-asset, skipDependencies and skipDevDependencies. skipDevDependencies should be boolean value, and in case of "true", all devDependencies skipped. Sample config:
Here is the patch: https://gist.github.com/Zaporozhec7/6ba54ad9369e44d6b83df0ca2e10a896 EDITED: Seems I missed something, that my solution cause bugs with some packages. |
@francoispluchino, was this fixed? Or does closing mean we'll suffer forever? |
Your error isn't a bug, because Composer can only install a single version of the same dependency (npm-asset/underscore[1.6.0, 1.4.4]). Use the And Composer doesn't install the dev dependencies. On the other hand, Composer analyzes the dev section, and therefore the plugin imports the packages. It's not a bug, it's the standard behavior of Composer. So, I want to re-open this issue if it's for an optimization request, but not for a report of a bug that is not one :-). |
Agree, but complaint was that it doesn't make any sense to do anything with frontend dev dependencies in Composer. Analyzing those dev dependencies takes time as well as become a source of unnecessary conflicts:
I agree this might not be a bug, but rather a very good optimization to have. |
I agree with you. So, I reopen this issue and change the labels. Just for info, I closed all the old issues with the label |
I think, for this to happen it should be enough to simplify following: composer-asset-plugin/Converter/AbstractPackageConverter.php Lines 173 to 184 in 61352d9
to: protected function getMapDependencies()
{
return array(
'dependencies' => 'require',
);
} If this is not desired to be hardcoded, new options would be nice to have. |
…plugin#269 is properly resolved
This is very important IMHO, just try to install
It has Babel in it's
I think there has to be an option to discard |
Yes. |
@francoispluchino Would it be possible to get a fix for this? CAP is practically unusable with npm-assets. |
If we can get the value of the |
I think it should be disabled by default and not depending on composer If you need development packages for client packages you also have the development tools. |
Performance improved by 3ec92aa. |
Composer 1.3.0 stable
fxp/composer-asset-plugin 1.2.2 stable
package.json:
What should be installed (dependencies tree without devDependencies on any level):
And now look at this (ignore error for now):
Clearly more packages than necessary.
The text was updated successfully, but these errors were encountered: