@caweb/cli 1.5.8 → 1.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commands/webpack/webpack.js +7 -2
- package/lib/cli.js +1 -0
- package/package.json +2 -2
|
@@ -20,10 +20,12 @@ import {
|
|
|
20
20
|
* @param {Object} options
|
|
21
21
|
* @param {boolean} options.debug True if debug mode is enabled.
|
|
22
22
|
* @param {boolean} options.audit Add CSS-Audit Page to pages served.
|
|
23
|
+
* @param {boolean} options.template Serves the project using templating.
|
|
23
24
|
*/
|
|
24
25
|
export default async function webpack({
|
|
25
26
|
spinner,
|
|
26
|
-
debug,
|
|
27
|
+
debug,
|
|
28
|
+
template
|
|
27
29
|
} ) {
|
|
28
30
|
const webpackCommand = 'build' === process.argv[2] ? 'build' : 'serve' ;
|
|
29
31
|
|
|
@@ -67,7 +69,10 @@ export default async function webpack({
|
|
|
67
69
|
if( customConfig.length ){
|
|
68
70
|
webpackConfig = deepmerge(webpackConfig.default, customConfig.default);
|
|
69
71
|
}
|
|
70
|
-
|
|
72
|
+
|
|
73
|
+
// add the template flag to the node options
|
|
74
|
+
process.env.NODE_OPTIONS = `${process.env.NODE_OPTIONS} --template ${template}`;
|
|
75
|
+
|
|
71
76
|
// run the webpackCommand command.
|
|
72
77
|
await runCmd(
|
|
73
78
|
'webpack',
|
package/lib/cli.js
CHANGED
|
@@ -55,6 +55,7 @@ function addWebpackCmds(){
|
|
|
55
55
|
// Serve Command.
|
|
56
56
|
program.command('serve')
|
|
57
57
|
.description('Serve the current project')
|
|
58
|
+
.addOption(new Option('--template <template>', 'Serves the project using templating.').choices(['default', 'blank']).default('default'))
|
|
58
59
|
.option( '--audit', 'Performs WordPress CSS-Audit.', true )
|
|
59
60
|
.option( '--no-audit', 'Skips WordPress CSS-Audit.', false )
|
|
60
61
|
.option( '--a11y', 'Performs IBM Accessibility Checker.', true )
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caweb/cli",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.9",
|
|
4
4
|
"description": "CAWebPublishing Command Line Interface.",
|
|
5
5
|
"exports": "./lib/env.js",
|
|
6
6
|
"type": "module",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@caweb/webpack": "^1.1.
|
|
59
|
+
"@caweb/webpack": "^1.1.3",
|
|
60
60
|
"@inquirer/prompts": "^5.3.2",
|
|
61
61
|
"@wordpress/create-block": "^4.46.0",
|
|
62
62
|
"@wordpress/env": "^10.3.0",
|