drupal-asset-library-versions

1.0.18 • Public • Published

Drupal Asset Library Versions

Description

Add and update asset version numbers in your *.libraries.yml file automatically using git status and the file paths from webpack.mix.js.

Usage

  • Configure the dalv command that was added in the scripts section of package.json. Configuration details below.
  • Add the dalv command to the end of the production command in the scripts section of package.json
  • The script will run automatically on npm run production.

Configure

On npm install, following script command will be automatically prepended to the scripts section of package.json.

"dalv": "drupal-asset-library-versions --compiledFiles=main.js,main.css --librariesYmlDir=../"

This command can be used on its own npm run dalv, however, it should to be added to the end of the production command for a more succinct workflow, and also so the script can work with specified compiled files.

E.g.

"production": "npx mix --production && npm run dalv"

The compiledFiles config option is provided to specify compiled files that map to a library in *.libraries.yml. main.js,main.css are the default values. This is a comma separated list.

The librariesYmlDir config option is provided to specify the location of *.libraries.yml relative to the current directory (i.e. where package.json is located). The default value is ../.

Package Sidebar

Install

npm i drupal-asset-library-versions

Weekly Downloads

0

Version

1.0.18

License

ISC

Unpacked Size

11 kB

Total Files

4

Last publish

Collaborators

  • desie314
  • agencylabs