Skip to content

Commit

Permalink
Bump version and update README
Browse files Browse the repository at this point in the history
  • Loading branch information
fumikito committed Feb 5, 2025
1 parent 82c558c commit 248ffa2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,27 @@ assets

And run this in your [npm scripts](https://docs.npmjs.com/misc/scripts) or [gulpfile.js](https://gulpjs.com/).

```js
// Import function.
const { dumpSetting } = require('@kunoichi/grab-deps');
// Dump JSON
dumpSetting( 'assets' );
### NPM Scripts

Since version 2.0.0, CLI inter face is available.
If you need traspiling JavaScripts with [@wordpress/scripts](https://www.npmjs.com/package/@wordpress/scripts), add dependencies.

```json
{
"dependencies": {
"@kunoichi/grab-deps": "^2.0.0",
"@wordpress/sripts": "^27.0.0"
},
"scripts": {
"dump": "grab-deps assets",
"transpile": "grab-deps js src/js assets/js"
}
}
```

For automatic dumping, watch assets directory.
`grab-deps-image 'test/src/images/**/*.{jpg,png,gif,svg}' test/dist/images` is also available. See peer dependencies for more information.

### Gulp

```js
// gulpfile.js
Expand All @@ -56,7 +69,7 @@ gulp.task( 'watch', function () {
} );
```

Now you can get updated dump information whatever changes you made for assets.
Now you can get updated dump information whatever changes you made for assets directory.

## Register Assets in WordPress

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kunoichi/grab-deps",
"version": "1.3.1",
"version": "2.0.0",
"description": "Grab dependencies from js/css files.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 248ffa2

Please sign in to comment.