Skip to content
Snippets Groups Projects
Commit 84aa6785 authored by Bohdan Melnychuk's avatar Bohdan Melnychuk
Browse files

Issue #3391074: Allow to install library using composer

parent 283a684e
No related branches found
No related tags found
1 merge request!5Issue #3391074: Allow to install library using composer
Darkmode
Module and dependencies installation:
-------------------------------------
1) Run `composer require oomphinc/composer-installers-extender`, to install
an additional package allowing you to install Darkmode.JS as npm-asset from
asset-packagist.org.
2) Set the new repository for the composer to download npm-asset packages:
```yaml
{
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
},
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
}
```
3) Update the extra settings to define new installers types and configure them:
```yaml
{
"extra": {
"installer-types": [ "bower-asset", "npm-asset" ],
"drupal-scaffold": {
...
},
"installer-paths": {
"web/core": [
"type:drupal-core"
],
"web/libraries/{$name}": [
"type:drupal-library",
"type:bower-asset",
"type:npm-asset"
],
...
},
},
}
```
4) Run `composer require drupal/darkmode npm-asset/darkmode-js:1.5.7`,
to install module and it's dependencies.
----
darkmodejs:
js:
https://cdn.jsdelivr.net/npm/darkmode-js@1.5.7/lib/darkmode-js.min.js: {type: external, minified: true}
/libraries/darkmode-js/lib/darkmode-js.min.js: {type: external, minified: true}
initiator:
js:
js/init.js: {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment