mirror of
https://github.com/desandro/imagesloaded.git
synced 2026-01-09 14:38:02 -05:00
👟 dist and version tasks
This commit is contained in:
11
package.json
11
package.json
@@ -13,6 +13,12 @@
|
||||
"qunit": "^2.17.2",
|
||||
"terser": "^5.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "npm run lint",
|
||||
"lint": "npx eslint .",
|
||||
"dist": "node tasks/dist.js",
|
||||
"version": "node tasks/version.js && npm run dist && git add -A ."
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/desandro/imagesloaded.git"
|
||||
@@ -32,10 +38,5 @@
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "npm run lint",
|
||||
"lint": "npx eslint .",
|
||||
"version": "node bin/version.js && npm run dist && git add -A css js dist"
|
||||
},
|
||||
"author": "David DeSandro"
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@ const fs = require('fs');
|
||||
const { execSync } = require('child_process');
|
||||
const { minify } = require('terser');
|
||||
|
||||
const indexPath = 'js/index.js';
|
||||
const indexPath = 'imagesloaded.js';
|
||||
const distPath = 'imagesloaded.pkgd.js';
|
||||
const distMinPath = 'imagesloaded.min.js';
|
||||
const distMinPath = 'imagesloaded.pkgd.min.js';
|
||||
|
||||
let indexContent = fs.readFileSync( `./${indexPath}`, 'utf8' );
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
const fs = require('fs');
|
||||
const version = require('../package.json').version;
|
||||
|
||||
const file = 'imagesloaded.js';
|
||||
|
||||
let src = fs.readFileSync( file, 'utf8' );
|
||||
src = src.replace( /imagesLoaded v\d+\.\d+\.\d+/, `imagesLoaded v${version}` );
|
||||
fs.writeFileSync( file, src, 'utf8' );
|
||||
|
||||
Reference in New Issue
Block a user