简体   繁体   中英

Requiring Gulp in composer.json

How can I require Gulp in a composer.json file? The composer ( php>=7.0 ) should install gulp and gulp-sass (and probably npm ) for a developer who has not installed them. The possible solution should be the code to add in a composer.json file. I want to know how developers handle this situation. How do they create a composer-ready development project?

NPM has it's own file packages.json to hold dependencies. When you install a new project you have to run npm install and all packages will be installed on the system in the node_modules folder. But first you have to install npm in your own. Every system has it's own package manager to install npm and most people download it from the website to get the latest version.

I think it's not really common to run everything from your composer file. I think it's possible but not really common.

https://nodesource.com/blog/an-absolute-beginners-guide-to-using-npm/

Asset Packagist might be the solution : https://asset-packagist.org/site/about

"repositories": [
    {
        "type": "composer",
        "url": "https://asset-packagist.org"
    }
],
"require": {
    "npm-asset/gulp": "^4.0.2",
    "npm-asset/gulp-sass": "^4.1.0"
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM