Skip to content

Commit

Permalink
= 4.2.7.6 =
Browse files Browse the repository at this point in the history
~ Tweak build tool.
  • Loading branch information
tungnxt89 committed Dec 24, 2024
1 parent cfba67c commit af958a1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
33 changes: 33 additions & 0 deletions build-release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Build sequence task
*
* @since 4.1.3
* @version 1.0.0
*/
const {spawn} = require('child_process');

console.log('Starting build...');

// Run command: npm run start
const buildJS = spawn('npm', ['run', 'start'], {
stdio: 'inherit',
shell: true,
});

buildJS.on('exit', () => {
console.log('Build finished.');
});

buildJS.on('spawn', () => {
// Run command: npm run build-makepot-zip
const releaseProcess = spawn('npm', ['run', 'build-makepot-zip'], {
stdio: 'inherit',
shell: true
});

releaseProcess.on('exit', (code) => {
buildJS.kill();
});
});


9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
"description": "[![Stories in Ready](https://badge.waffle.io/LearnPress/LearnPress.svg?label=ready&title=Ready)](http://waffle.io/LearnPress/LearnPress)",
"main": "index.js",
"scripts": {
"dev": "cross-env NODE_OPTIONS=--openssl-legacy-provider wp-scripts start",
"start": "cross-env NODE_OPTIONS=--openssl-legacy-provider wp-scripts start",
"build": "cross-env NODE_OPTIONS=--openssl-legacy-provider wp-scripts build",
"format-js": "cross-env NODE_OPTIONS=--openssl-legacy-provider wp-scripts format ./assets/src",
"dev-build": "cross-env NODE_OPTIONS=--openssl-legacy-provider npm run build && gulp styles && npm run dev",
"release": "npm run build && npm run makepot && gulp styles && gulp release",
"makepot:js": "wp-babel-makepot \"./assets/src/**/*.{js,jsx,ts,tsx}\" --ignore \"**/node_modules/**,**/test/**,**/*.d.ts\" --base \"./\" --dir \"./languages/strings\" --output \"./languages/learnpress-js.pot\"",
"makepot:cli": "wp i18n make-pot . languages/learnpress.pot --skip-audit --merge=languages/learnpress-js.pot --exclude=\"test,releases,build,dist,node_modules,vendor,wordpress\"",
"makepot": "npm rum makepot:js && npm run makepot:cli && gulp updatePot"
"makepot": "npm rum makepot:js && npm run makepot:cli && gulp updatePot",
"build-makepot-zip": "npm run build && npm run makepot && gulp styles && gulp release",
"release": "node build-release.js"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -67,7 +68,7 @@
"cropperjs": "1.6.2",
"style-loader": "3.3.4",
"file-loader": "6.2.0",
"mini-css-extract-plugin": "2.9.1",
"mini-css-extract-plugin": "2.9.2",
"toastify-js": "1.12.0"
}
}

0 comments on commit af958a1

Please sign in to comment.