@caweb/webpack 1.2.17 → 1.2.18
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/package.json +2 -2
- package/webpack.config.js +10 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caweb/webpack",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.18",
|
|
4
4
|
"description": "CAWebPublishing Webpack Configuration",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@caweb/css-audit-webpack-plugin": "^1.0.11",
|
|
44
44
|
"@caweb/html-webpack-plugin": "^1.4.8",
|
|
45
45
|
"@caweb/jshint-webpack-plugin": "^1.0.8",
|
|
46
|
-
"@wordpress/scripts": "^
|
|
46
|
+
"@wordpress/scripts": "^30.0.2",
|
|
47
47
|
"html-webpack-link-type-plugin": "^1.1.1",
|
|
48
48
|
"html-webpack-skip-assets-plugin": "^1.0.4"
|
|
49
49
|
}
|
package/webpack.config.js
CHANGED
|
@@ -20,28 +20,20 @@ import {HtmlWebpackLinkTypePlugin} from 'html-webpack-link-type-plugin';
|
|
|
20
20
|
|
|
21
21
|
const webpackCommand = 'build' === process.argv[2] ? 'build' : 'serve' ;
|
|
22
22
|
|
|
23
|
+
const flags = process.argv0.split(' ');
|
|
24
|
+
|
|
23
25
|
// only if serving do we add the plugins
|
|
24
26
|
if( 'serve' === webpackCommand ){
|
|
25
|
-
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if( process.env.NODE_OPTIONS ){
|
|
30
|
-
let opts = process.env.NODE_OPTIONS.split(' ').filter(e=>e).map(o=>o.replaceAll("'", ''))
|
|
31
|
-
if( opts.includes('--template') ){
|
|
32
|
-
template = opts[opts.indexOf('--template') + 1]
|
|
33
|
-
}
|
|
34
|
-
if( opts.includes('--scheme') ){
|
|
35
|
-
scheme = opts[opts.indexOf('--scheme') + 1]
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
27
|
+
|
|
28
|
+
let template = flags.includes('--template') ? flags[flags.indexOf('--template') + 1] : 'default';
|
|
29
|
+
let scheme = flags.includes('--scheme') ? flags[flags.indexOf('--scheme') + 1] : 'oceanside';
|
|
30
|
+
|
|
39
31
|
// Page Template and additional plugins
|
|
40
32
|
webpackConfig.plugins.push(
|
|
41
33
|
new CAWebHTMLPlugin({
|
|
42
34
|
template,
|
|
43
35
|
templateParameters: {
|
|
44
|
-
scheme
|
|
36
|
+
scheme: 'false' !== scheme ? scheme : false
|
|
45
37
|
},
|
|
46
38
|
skipAssets: [
|
|
47
39
|
/.*-rtl.css/, // we skip the Right-to-Left Styles
|
|
@@ -53,9 +45,9 @@ if( 'serve' === webpackCommand ){
|
|
|
53
45
|
}),
|
|
54
46
|
new HtmlWebpackSkipAssetsPlugin(),
|
|
55
47
|
new HtmlWebpackLinkTypePlugin(),
|
|
56
|
-
new JSHintPlugin(),
|
|
57
|
-
new CSSAuditPlugin(),
|
|
58
|
-
new A11yPlugin()
|
|
48
|
+
! flags.includes('--no-jshint') ? new JSHintPlugin() : false,
|
|
49
|
+
! flags.includes('--no-audit') ? new CSSAuditPlugin() : false,
|
|
50
|
+
! flags.includes('--no-a11y') ? new A11yPlugin() : false
|
|
59
51
|
)
|
|
60
52
|
}
|
|
61
53
|
|