covert Yii2 npm-asset
or bower-asset
to package.json
, so that Foxy can install.
composer require kriss/foxy-yii2-convert -vvv
- add
provide
tocomposer.json
to skip installnpm-asset
orbower-asset
like this:
{
"provide": {
"bower-asset/bootstrap": "*",
"bower-asset/jquery": "*",
"bower-asset/inputmask": "*",
"bower-asset/punycode": "*",
"bower-asset/yii2-pjax": "*",
"npm-asset/wangeditor": "*",
"npm-asset/webuploader": "*",
"bower-asset/typeahead.js": "*"
},
}
-
remove composer-asset-plugin or asset-packagist if you used in project
-
composer install
-
chage Yii2 npm and bower aliase
like this
'aliases' => [
'@bower' => '@project/node_modules',
'@npm' => '@project/node_modules',
],
Q: If one package I dont want to install view npm?
A: Like almasaeed2010/adminlte, it can be installed by composer, you can config this in composer.json like:
"config": {
"foxy": {
"enabled": true,
"manager": "yarn",
"enable-packages": {
"almasaeed2010/adminlte": false, // this tip
"*": true // must be added to the last
}
}
},
Q: If one package has
package.json
,and just use for develop?
A: Like kartik-v/dependent-dropdown, you can config this in composer.json like:
"config": {
"foxy": {
"enabled": true,
"manager": "yarn",
"enable-packages": {
"kartik-v/dependent-dropdown": false, // this tip
"*": true // must be added to the last
}
}
},
Q: If one package is dont have same npm package name in bower?