
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
grunt-wp-assets
Advanced tools
WordPress assets revisioning.
Grunt.js plugin that searches requested WordPress static asset, revisioning, and update static asset reference in given target (tested in wp_enqueue_style
and wp_register_script
).
This plugin requires Grunt ~0.4.1
Install this plugin with this command:
npm install grunt-wp-assets --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-wp-assets');
version: {
assets: {
files: {
'path/to/target.php': ['path/to/style.css', 'path/to/scripts.js']
}
}
},
This example task will copy path/to/style.css
to assets/css/{md5hash}.style.css
and path/to/scripts.js
to path/to/{md5hash}.scripts.js
and update assets reference in path/to/target.php
.
version: {
assets: {
options: {
algorithm: 'sha1',
length: 4,
format: false,
rename: true,
manifest: 'assets/manifest.json',
},
files: {
'scripts.php': ['assets/css/main.min.css', 'assets/js/scripts.min.js']
}
}
},
This example task will rename assets/css/main.min.css
to assets/css/main.{sha1hash}.min.css
and assets/js/scripts.min.js
to assets/js/scripts.{sha1hash}.min.js
and update assets reference in scripts.php
. Also generate assets summary at assets/manifest.json
.
Type: Boolean
Default: false
It will rename the src
target instead of copy.
Type: Boolean
Default: false
File name format.
false: {hash}.{filename}.{ext}
true: {filename}.{hash}.{ext}
Type: Boolean
Default: true
It is minify version?
Type: String
Default: min
// set minifyname: minify if you have filename like this
main.minify.css
scripts.minify.js
Type: String
Default: 'utf8'
The file encoding.
Type: String
Default: 'md5'
algorithm
is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are 'sha1'
, 'md5'
, 'sha256'
, 'sha512'
, etc. On recent releases, openssl list-message-digest-algorithms
will display the available digest algorithms.
Type: Number
Default: 4
The number of characters of the file hash to prefix the file name with.
Type: String
Default: undefined
Name used as a handle for the stylesheet.
Type: String
Default: undefined
Name used as a handle for the script.
Type: String
Default: undefined
Destination of JSON manifest contain the asset path
(filename path), handle
and querystring
(if querystring use), and hash
for each versioned file.
Sample manifest.json
{
"dest": "assets/manifest.json",
"assets/css/main.min.css": {
"path": "assets/css/main.min.css",
"hash": "060865602e1c6ad3e02ee2ebf60799a0",
"handle": "roots_css"
},
"assets/js/scripts.min.js": {
"path": "assets/js/scripts.min.js",
"hash": "0fc6af96786d8f267c8686338a34cd38",
"handle": "roots_js"
},
"querystring": true
}
Type: Boolean
Default: false
Generate manifest json without make change to destination script.
DATE VERSION CHANGES
querystring
to manifest.json when enable,Update manifest json sampleminify
and minifyname
.,Change default option for format
to false
.,Update simple test assets.style
and script
.,Update docs.Copyright (c) 2014 Hariadi Hinta, contributors.
Released under the MIT license
FAQs
WordPress assets revisioning.
The npm package grunt-wp-assets receives a total of 6 weekly downloads. As such, grunt-wp-assets popularity was classified as not popular.
We found that grunt-wp-assets demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.