@caweb/webpack 1.2.0 → 1.2.1

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.
Files changed (2) hide show
  1. package/package.json +4 -3
  2. package/webpack.config.js +19 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caweb/webpack",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "CAWebPublishing Webpack Configuration",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -41,8 +41,9 @@
41
41
  "dependencies": {
42
42
  "@caweb/a11y-webpack-plugin": "^1.0.5",
43
43
  "@caweb/css-audit-webpack-plugin": "^1.0.5",
44
- "@caweb/html-webpack-plugin": "^1.2.0",
44
+ "@caweb/html-webpack-plugin": "^1.2.1",
45
45
  "@caweb/jshint-webpack-plugin": "^1.0.6",
46
- "@wordpress/scripts": "^28.4.0"
46
+ "@wordpress/scripts": "^28.4.0",
47
+ "html-webpack-skip-assets-plugin": "^1.0.4"
47
48
  }
48
49
  }
package/webpack.config.js CHANGED
@@ -17,10 +17,28 @@ import A11yPlugin from '@caweb/a11y-webpack-plugin';
17
17
 
18
18
  import {HtmlWebpackSkipAssetsPlugin} from 'html-webpack-skip-assets-plugin';
19
19
 
20
+ let template = 'default';
21
+ let scheme = 'oceanside';
22
+
23
+ // Allow for template to be selected via NODE_OPTIONS env variable
24
+ if( process.env.NODE_OPTIONS ){
25
+ let opts = process.env.NODE_OPTIONS.split(' ').filter(e=>e).map(o=>o.replaceAll("'", ''))
26
+ if( opts.includes('--template') ){
27
+ template = opts[opts.indexOf('--template') + 1]
28
+ }
29
+ if( opts.includes('--scheme') ){
30
+ scheme = opts[opts.indexOf('--scheme') + 1]
31
+ }
32
+ }
20
33
 
21
34
  // Page Template and additional plugins
22
35
  webpackConfig.plugins.push(
23
- new CAWebHTMLPlugin(),
36
+ new CAWebHTMLPlugin({
37
+ template,
38
+ templateParameters: {
39
+ scheme
40
+ }
41
+ }),
24
42
  new HtmlWebpackSkipAssetsPlugin(),
25
43
  new JSHintPlugin(),
26
44
  new CSSAuditPlugin(),