@caweb/webpack 1.2.28 → 1.3.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 (83) hide show
  1. package/.github/workflows/config-publish.yml +33 -0
  2. package/.github/workflows/plugins-publish.yml +45 -0
  3. package/.github/workflows/test +29 -0
  4. package/.gitmodules +3 -0
  5. package/README.md +1 -2
  6. package/changelog.txt +140 -0
  7. package/package.json +9 -16
  8. package/plugins/a11y/README.md +19 -0
  9. package/plugins/a11y/aceconfig.js +44 -0
  10. package/plugins/a11y/changelog.txt +31 -0
  11. package/plugins/a11y/index.js +271 -0
  12. package/plugins/a11y/package-lock.json +3303 -0
  13. package/plugins/a11y/package.json +42 -0
  14. package/plugins/css-audit/README.md +20 -0
  15. package/plugins/css-audit/changelog.txt +41 -0
  16. package/plugins/css-audit/css-audit.config.cjs +5 -0
  17. package/plugins/css-audit/default.config.js +19 -0
  18. package/plugins/css-audit/index.js +326 -0
  19. package/plugins/css-audit/package-lock.json +1522 -0
  20. package/plugins/css-audit/package.json +53 -0
  21. package/plugins/css-audit/sample/no-files.html +9 -0
  22. package/plugins/html/README.md +40 -0
  23. package/plugins/html/changelog.txt +139 -0
  24. package/plugins/html/entry/delta.js +20 -0
  25. package/plugins/html/entry/eureka.js +20 -0
  26. package/plugins/html/entry/mono.js +20 -0
  27. package/plugins/html/entry/oceanside.js +20 -0
  28. package/plugins/html/entry/orangecounty.js +20 -0
  29. package/plugins/html/entry/pasorobles.js +20 -0
  30. package/plugins/html/entry/sacramento.js +20 -0
  31. package/plugins/html/entry/santabarbara.js +20 -0
  32. package/plugins/html/entry/santacruz.js +20 -0
  33. package/plugins/html/entry/shasta.js +20 -0
  34. package/plugins/html/entry/sierra.js +20 -0
  35. package/plugins/html/entry/trinity.js +20 -0
  36. package/plugins/html/index.js +96 -0
  37. package/plugins/html/package-lock.json +21977 -0
  38. package/plugins/html/package.json +71 -0
  39. package/plugins/html/sample/blank.html +13 -0
  40. package/plugins/html/sample/components/alerts.html +32 -0
  41. package/plugins/html/sample/components/animations.html +7 -0
  42. package/plugins/html/sample/components/buttons.html +5 -0
  43. package/plugins/html/sample/components/cards.html +73 -0
  44. package/plugins/html/sample/components/lists.html +75 -0
  45. package/plugins/html/sample/components/locations.html +49 -0
  46. package/plugins/html/sample/components/profile-banners.html +48 -0
  47. package/plugins/html/sample/components/sections.html +16 -0
  48. package/plugins/html/sample/components/service-tiles.html +73 -0
  49. package/plugins/html/sample/components/typography.html +42 -0
  50. package/plugins/html/sample/default.html +31 -0
  51. package/plugins/html/sample/favicon.ico +0 -0
  52. package/plugins/html/sample/images/black_puppy.jpg +0 -0
  53. package/plugins/html/sample/images/dolphin_marine_mammals_water.jpg +0 -0
  54. package/plugins/html/sample/images/grayscale_mountain.jpg +0 -0
  55. package/plugins/html/sample/images/silhouette.png +0 -0
  56. package/plugins/html/sample/images/squirrel_tail_bushy_tail.jpg +0 -0
  57. package/plugins/html/sample/index.html +48 -0
  58. package/plugins/html/sample/missing/content.html +4 -0
  59. package/plugins/html/sample/structural/branding.html +15 -0
  60. package/plugins/html/sample/structural/footer.html +47 -0
  61. package/plugins/html/sample/structural/header.html +16 -0
  62. package/plugins/html/sample/structural/mobile-controls.html +5 -0
  63. package/plugins/html/sample/structural/navigation.html +26 -0
  64. package/plugins/html/sample/structural/search.html +15 -0
  65. package/plugins/html/sample/structural/utility-header.html +23 -0
  66. package/plugins/html/scripts/create-entrypoints.js +62 -0
  67. package/plugins/html/scripts/icon.js +60 -0
  68. package/plugins/html/scripts/webpack.test.js +41 -0
  69. package/plugins/html/webpack.config.js +287 -0
  70. package/plugins/jshint/.jshintrc +31 -0
  71. package/plugins/jshint/README.md +26 -0
  72. package/plugins/jshint/changelog.txt +30 -0
  73. package/plugins/jshint/index.js +296 -0
  74. package/plugins/jshint/package-lock.json +1779 -0
  75. package/plugins/jshint/package.json +45 -0
  76. package/plugins/jshint/reporter.cjs +663 -0
  77. package/plugins/jshint/sample/jshint.css +247 -0
  78. package/plugins/jshint/sample/jshint.html +7 -0
  79. package/plugins/jshint/sample/jshint.js +25 -0
  80. package/plugins/jshint/sample/no-files.html +9 -0
  81. package/sample/index.html +364 -0
  82. package/scripts/update-deps.js +38 -0
  83. package/webpack.config.js +0 -54
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@caweb/css-audit-webpack-plugin",
3
+ "version": "1.0.12",
4
+ "description": "CAWebPublishing Webpack Plugin to run WordPress CSS Audit",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "bin": {
8
+ "auditor": "bin/auditor/index.js"
9
+ },
10
+ "files": [
11
+ "bin",
12
+ "sample",
13
+ "css-audit.config.cjs",
14
+ "default.config.js",
15
+ "index.js",
16
+ "README.md"
17
+ ],
18
+ "author": "CAWebPublishing",
19
+ "license": "ISC",
20
+ "bugs": {
21
+ "url": "https://github.com/CAWebPublishing/webpack/issues"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "homepage": "https://github.com/CAWebPublishing/webpack#readme",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/CAWebPublishing/webpack",
30
+ "directory": "plugins/css-audit"
31
+ },
32
+ "keywords": [
33
+ "caweb",
34
+ "cagov",
35
+ "webpack"
36
+ ],
37
+ "scripts": {
38
+ "webpack": "webpack",
39
+ "postinstall": "cd bin/auditor && npm ci",
40
+ "test": "echo \"Error: run tests from root\" && exit 0"
41
+ },
42
+ "dependencies": {
43
+ "chalk": "^5.3.0",
44
+ "cross-spawn": "^7.0.3",
45
+ "deepmerge": "^4.3.1",
46
+ "get-all-files": "^5.0.0",
47
+ "resolve-bin": "^1.0.1"
48
+ },
49
+ "devDependencies": {
50
+ "webpack": "^5.96.1",
51
+ "webpack-cli": "^5.1.4"
52
+ }
53
+ }
@@ -0,0 +1,9 @@
1
+ <html>
2
+ <head>
3
+ <title>CSS Audit - No Files</title>
4
+ </head>
5
+ <body>
6
+ <strong>No file(s) or directory path(s) were given or default directory was not found.'</strong>
7
+ <strong>Auditor did not execute.</strong>
8
+ </body>
9
+ </html>
@@ -0,0 +1,40 @@
1
+ This plugin utilizes the HTML Webpack Plugin to launch static generated pages using the CAWeb Template (formerly the California State Template)
2
+
3
+ <i>This package is inspired by [wp-scripts](https://www.npmjs.com/package/@wordpress/scripts)</i>
4
+
5
+ ## Plugins Used
6
+ - [html-webpack-plugin](https://www.npmjs.com/package/html-webpack-plugin)
7
+
8
+ ## Installation
9
+ <pre>npm install --save-dev @caweb/html-webpack-plugin</pre>
10
+
11
+ ## Get Started
12
+ In your Webpack configuration simply add the plugin to your existing plugin array.
13
+
14
+ <pre>
15
+ import CAWebHTMLPlugin from '@caweb/html-webpack-plugin';
16
+
17
+ export default {
18
+ plugins: [
19
+ new CAWebHTMLPlugin()
20
+ ]
21
+ }
22
+ </pre>
23
+
24
+ ## Options
25
+ All html-webpack-plugin [options](https://github.com/jantimon/html-webpack-plugin?tab=readme-ov-file#options) are available along with the following:
26
+ <code>template</code> - blank or default, Default will launch a site with a templated header/footer area, blank will not.
27
+ <code>scheme</code> - Colorscheme to utilitze.
28
+ **Available schemes:**
29
+ * delta
30
+ * eureka
31
+ * mono
32
+ * oceanside
33
+ * orangecounty
34
+ * pasorobles
35
+ * sacramento
36
+ * santabarbara
37
+ * santacruz
38
+ * shasta
39
+ * sierra
40
+ * trinity
@@ -0,0 +1,139 @@
1
+ v1.5.2
2
+ - Fixed issue with webpack plugins still being added even when flags are passed
3
+ - Reverted multiple configuration export change back to single config export
4
+ - Reduced font size for footer social icons
5
+
6
+ v1.5.1
7
+ - updated npm packages
8
+ - Changed mobile control structure, navigation and search are now in the mobile overlay
9
+ - Added logic for header/footer nav, social share links, utility links, Google Search ID, template parameters passable via caweb.json
10
+ - Webpack configuration from @caweb/webpack package moved into this configuration
11
+ - Webpack config handles --mode flag appropriately
12
+ - Webpack config now exports multiple configurations
13
+ - Webpack configuration now outputs minified files
14
+
15
+ v1.5.0
16
+ - Template parameters alerts, logo, passable via caweb.json
17
+ - Added logic for alerts, logo
18
+
19
+ v1.4.17
20
+ - Fixed issue with alerts rendering in mobile
21
+
22
+ v1.4.16
23
+ - Fixed issue with Card Standout triangle not centering properly
24
+
25
+ v1.4.15
26
+ - Removed selector false from test script
27
+ - Fixed issue with search and navigation flickering when loaded on mobile
28
+
29
+ v1.4.14
30
+ - Font weight variables removed
31
+ - Side navigation List and Step Lists styles added back to lists
32
+ - Fixed issue with mobile controls
33
+
34
+ v1.4.13
35
+ - Dark mode script turned off
36
+
37
+ v1.4.12
38
+ - Updated ca-gov-logo-svg
39
+ - Added link grid styles back
40
+ - Added breadcrumbs styles back
41
+ - Added side-navigation styles back
42
+
43
+ v1.4.11
44
+ - Added cursor- utility classes
45
+
46
+ v1.4.10
47
+ - Unnested search styles
48
+
49
+ v1.4.9
50
+ - Fixed issue with page-title,page-date not styling like containers
51
+ - Fixed issue with executive profiles dark text
52
+ - Fixed issue with understated card header color
53
+
54
+ v1.4.8
55
+ - Increased font size for Service Tile more button
56
+
57
+ v1.4.7
58
+ - Fixed issue with Service Tile more button
59
+
60
+ v1.4.6
61
+ - Removed margin-bottom from headings
62
+ - Fixed issue with social-share-colors
63
+ - Added new dark theme support for High Contrast Mode
64
+
65
+ v1.4.5
66
+ - Fixed issue with project sample favicon not picking up
67
+
68
+ v1.4.4
69
+ - External link now apply to all links with target = _blank
70
+
71
+ v1.4.3
72
+ - Dropdown nav menu width set to auto
73
+ - Removed background color from location banner more details button
74
+
75
+ v1.4.2
76
+ - Added sample images
77
+ - Test template was removed
78
+ - Updated test scripts
79
+ - Updated template files
80
+
81
+ v1.4.1
82
+ - Added gray-50 to bootstrap gray mapping
83
+ - Added background color to footer
84
+
85
+ v1.4.0
86
+ - Added new test template and sample files
87
+ - Template source files have been completely redone
88
+ - Added Animate.css https://animate.style/
89
+ - Added Bootstrap Forced Colors CSS https://www.npmjs.com/package/bootstrap-forced-colors-css
90
+ - Updated npm packages
91
+ - Added html-webpack-link-type-plugin
92
+
93
+ v1.3.3
94
+ - Updated Readme
95
+
96
+ v1.3.2
97
+ - Removed extra year from footer sample
98
+ - Added new font json script file
99
+ - Updated npm packages
100
+
101
+ v1.3.1
102
+ - Updated icon font library
103
+ - Moved icon font out of components directory
104
+ - Updated entrypoints to generate font-only sheet
105
+
106
+ v1.3.0
107
+ - Remediated State Template 6.3.2 source files
108
+
109
+ v1.2.2
110
+ - Added favicon to default
111
+
112
+ v1.2.1
113
+ - Removed console messages
114
+
115
+ v1.2.0
116
+ - Added new CAWebHTMLPlugin class which extends HtmlWebpackPlugin
117
+ - Moved @wordpress/scripts defaults to base configurations
118
+
119
+ v1.1.2
120
+ - Renamed index.html to blank.html to match args
121
+
122
+ v1.1.1
123
+ - Rolled changes back to index.html
124
+ - Added default.html for templating
125
+
126
+ v1.1.0
127
+ - Added State Template 6.3.2 source files
128
+ - Added script to generate multiple entrypoints for use when serving
129
+ - Added webconfig for multiple entrypoints based on colorschemes
130
+ - Added header/footer initial structural markup
131
+
132
+ v1.0.2
133
+ - Added content to template parameters
134
+
135
+ v1.0.1
136
+ - Added Page Template to HTML Plugin
137
+
138
+ v1.0.0
139
+ - Initial CAWeb HTML Webpack Plugin added
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Autogenerated Entrypoint
3
+ * DO NOT MODIFY
4
+ */
5
+
6
+ import path from 'path';
7
+ import { fileURLToPath } from 'url';
8
+ const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
9
+
10
+ export default {
11
+ entry: {
12
+ 'font-only': path.join(currentPath, 'src', 'styles', 'font-only.css'),
13
+ delta: [
14
+ path.join(currentPath, '/src/styles/font-only.css'),
15
+ path.join(currentPath, '/src/styles/colorschemes/delta.scss'),
16
+ path.join(currentPath, '/src/scripts/index.js')
17
+ ]
18
+ }
19
+ };
20
+
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Autogenerated Entrypoint
3
+ * DO NOT MODIFY
4
+ */
5
+
6
+ import path from 'path';
7
+ import { fileURLToPath } from 'url';
8
+ const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
9
+
10
+ export default {
11
+ entry: {
12
+ 'font-only': path.join(currentPath, 'src', 'styles', 'font-only.css'),
13
+ eureka: [
14
+ path.join(currentPath, '/src/styles/font-only.css'),
15
+ path.join(currentPath, '/src/styles/colorschemes/eureka.scss'),
16
+ path.join(currentPath, '/src/scripts/index.js')
17
+ ]
18
+ }
19
+ };
20
+
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Autogenerated Entrypoint
3
+ * DO NOT MODIFY
4
+ */
5
+
6
+ import path from 'path';
7
+ import { fileURLToPath } from 'url';
8
+ const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
9
+
10
+ export default {
11
+ entry: {
12
+ 'font-only': path.join(currentPath, 'src', 'styles', 'font-only.css'),
13
+ mono: [
14
+ path.join(currentPath, '/src/styles/font-only.css'),
15
+ path.join(currentPath, '/src/styles/colorschemes/mono.scss'),
16
+ path.join(currentPath, '/src/scripts/index.js')
17
+ ]
18
+ }
19
+ };
20
+
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Autogenerated Entrypoint
3
+ * DO NOT MODIFY
4
+ */
5
+
6
+ import path from 'path';
7
+ import { fileURLToPath } from 'url';
8
+ const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
9
+
10
+ export default {
11
+ entry: {
12
+ 'font-only': path.join(currentPath, 'src', 'styles', 'font-only.css'),
13
+ oceanside: [
14
+ path.join(currentPath, '/src/styles/font-only.css'),
15
+ path.join(currentPath, '/src/styles/colorschemes/oceanside.scss'),
16
+ path.join(currentPath, '/src/scripts/index.js')
17
+ ]
18
+ }
19
+ };
20
+
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Autogenerated Entrypoint
3
+ * DO NOT MODIFY
4
+ */
5
+
6
+ import path from 'path';
7
+ import { fileURLToPath } from 'url';
8
+ const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
9
+
10
+ export default {
11
+ entry: {
12
+ 'font-only': path.join(currentPath, 'src', 'styles', 'font-only.css'),
13
+ orangecounty: [
14
+ path.join(currentPath, '/src/styles/font-only.css'),
15
+ path.join(currentPath, '/src/styles/colorschemes/orangecounty.scss'),
16
+ path.join(currentPath, '/src/scripts/index.js')
17
+ ]
18
+ }
19
+ };
20
+
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Autogenerated Entrypoint
3
+ * DO NOT MODIFY
4
+ */
5
+
6
+ import path from 'path';
7
+ import { fileURLToPath } from 'url';
8
+ const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
9
+
10
+ export default {
11
+ entry: {
12
+ 'font-only': path.join(currentPath, 'src', 'styles', 'font-only.css'),
13
+ pasorobles: [
14
+ path.join(currentPath, '/src/styles/font-only.css'),
15
+ path.join(currentPath, '/src/styles/colorschemes/pasorobles.scss'),
16
+ path.join(currentPath, '/src/scripts/index.js')
17
+ ]
18
+ }
19
+ };
20
+
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Autogenerated Entrypoint
3
+ * DO NOT MODIFY
4
+ */
5
+
6
+ import path from 'path';
7
+ import { fileURLToPath } from 'url';
8
+ const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
9
+
10
+ export default {
11
+ entry: {
12
+ 'font-only': path.join(currentPath, 'src', 'styles', 'font-only.css'),
13
+ sacramento: [
14
+ path.join(currentPath, '/src/styles/font-only.css'),
15
+ path.join(currentPath, '/src/styles/colorschemes/sacramento.scss'),
16
+ path.join(currentPath, '/src/scripts/index.js')
17
+ ]
18
+ }
19
+ };
20
+
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Autogenerated Entrypoint
3
+ * DO NOT MODIFY
4
+ */
5
+
6
+ import path from 'path';
7
+ import { fileURLToPath } from 'url';
8
+ const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
9
+
10
+ export default {
11
+ entry: {
12
+ 'font-only': path.join(currentPath, 'src', 'styles', 'font-only.css'),
13
+ santabarbara: [
14
+ path.join(currentPath, '/src/styles/font-only.css'),
15
+ path.join(currentPath, '/src/styles/colorschemes/santabarbara.scss'),
16
+ path.join(currentPath, '/src/scripts/index.js')
17
+ ]
18
+ }
19
+ };
20
+
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Autogenerated Entrypoint
3
+ * DO NOT MODIFY
4
+ */
5
+
6
+ import path from 'path';
7
+ import { fileURLToPath } from 'url';
8
+ const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
9
+
10
+ export default {
11
+ entry: {
12
+ 'font-only': path.join(currentPath, 'src', 'styles', 'font-only.css'),
13
+ santacruz: [
14
+ path.join(currentPath, '/src/styles/font-only.css'),
15
+ path.join(currentPath, '/src/styles/colorschemes/santacruz.scss'),
16
+ path.join(currentPath, '/src/scripts/index.js')
17
+ ]
18
+ }
19
+ };
20
+
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Autogenerated Entrypoint
3
+ * DO NOT MODIFY
4
+ */
5
+
6
+ import path from 'path';
7
+ import { fileURLToPath } from 'url';
8
+ const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
9
+
10
+ export default {
11
+ entry: {
12
+ 'font-only': path.join(currentPath, 'src', 'styles', 'font-only.css'),
13
+ shasta: [
14
+ path.join(currentPath, '/src/styles/font-only.css'),
15
+ path.join(currentPath, '/src/styles/colorschemes/shasta.scss'),
16
+ path.join(currentPath, '/src/scripts/index.js')
17
+ ]
18
+ }
19
+ };
20
+
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Autogenerated Entrypoint
3
+ * DO NOT MODIFY
4
+ */
5
+
6
+ import path from 'path';
7
+ import { fileURLToPath } from 'url';
8
+ const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
9
+
10
+ export default {
11
+ entry: {
12
+ 'font-only': path.join(currentPath, 'src', 'styles', 'font-only.css'),
13
+ sierra: [
14
+ path.join(currentPath, '/src/styles/font-only.css'),
15
+ path.join(currentPath, '/src/styles/colorschemes/sierra.scss'),
16
+ path.join(currentPath, '/src/scripts/index.js')
17
+ ]
18
+ }
19
+ };
20
+
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Autogenerated Entrypoint
3
+ * DO NOT MODIFY
4
+ */
5
+
6
+ import path from 'path';
7
+ import { fileURLToPath } from 'url';
8
+ const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
9
+
10
+ export default {
11
+ entry: {
12
+ 'font-only': path.join(currentPath, 'src', 'styles', 'font-only.css'),
13
+ trinity: [
14
+ path.join(currentPath, '/src/styles/font-only.css'),
15
+ path.join(currentPath, '/src/styles/colorschemes/trinity.scss'),
16
+ path.join(currentPath, '/src/scripts/index.js')
17
+ ]
18
+ }
19
+ };
20
+
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * External dependencies
5
+ */
6
+ import fs from 'fs';
7
+ import path from 'path';
8
+ import chalk from 'chalk';
9
+ import deepmerge from 'deepmerge';
10
+ import { fileURLToPath, URL } from 'url';
11
+ import HtmlWebpackPlugin from 'html-webpack-plugin';
12
+ /*
13
+ import spawn from 'cross-spawn';
14
+ import { getAllFilesSync } from 'get-all-files'
15
+ import EntryDependency from "webpack/lib/dependencies/EntryDependency.js";
16
+ import fs from 'fs';
17
+
18
+ const boldWhite = chalk.bold.white;
19
+ const boldGreen = chalk.bold.green;
20
+ const boldBlue = chalk.bold.hex('#03a7fc');
21
+ */
22
+ const currentPath = path.dirname(fileURLToPath(import.meta.url));
23
+ const appPath = process.cwd();
24
+
25
+
26
+ /**
27
+ * Launches CAWeb HTML Markup
28
+ *
29
+ * Requires the devServer to be able to writeToDisk
30
+ * devMiddleware: {
31
+ * writeToDisk: true,
32
+ * }
33
+ *
34
+ * @class CAWebHTMLPlugin
35
+ * @typedef {CAWebHTMLPlugin}
36
+ * @extends {HtmlWebpackPlugin}
37
+ */
38
+ class CAWebHTMLPlugin extends HtmlWebpackPlugin{
39
+
40
+ // we change some of the html-webpack-plugin defaults
41
+ constructor(opts = {}) {
42
+ let templates = ['blank', 'default'];
43
+
44
+ let defaultOptions = {
45
+ title: path.basename( appPath ),
46
+ favicon: fs.existsSync(path.join(appPath, 'sample', 'favicon.ico')) ? path.join(appPath, 'sample', 'favicon.ico') : path.join(currentPath, 'sample', 'favicon.ico'),
47
+ inject: 'body',
48
+ template: path.join( currentPath, 'sample', 'default.html'),
49
+ scriptLoading: 'blocking',
50
+ meta: {
51
+ "Author": "CAWebPublishing",
52
+ "Description": "State of California",
53
+ "Keywords": "California,government",
54
+ "viewport": "width=device-width, initial-scale=1.0, maximum-scale=2.0"
55
+ },
56
+ templateParameters: {
57
+ "title": path.basename( appPath ),
58
+ "scheme": "oceanside",
59
+ "logo": "https://caweb.cdt.ca.gov/wp-content/uploads/sites/221/2023/06/caweb-publishing-logo.png"
60
+ },
61
+ }
62
+
63
+ // update templateParameters.title to match user options.
64
+ if( opts.title ){
65
+ defaultOptions.templateParameters.title = opts.title;
66
+ }
67
+
68
+ if( fs.existsSync( path.join(appPath, 'caweb.json') ) ){
69
+
70
+ let dataFile = JSON.parse( fs.readFileSync( path.join(appPath, 'caweb.json') ) );
71
+
72
+ if( dataFile.site ){
73
+ defaultOptions.templateParameters = {
74
+ ...defaultOptions.templateParameters,
75
+ ...dataFile.site
76
+ }
77
+ }
78
+
79
+ }
80
+
81
+ // select template file based on template selection if template is one of ours
82
+ if( opts.template && templates.includes(opts.template) ){
83
+ opts.template = path.join( currentPath, 'sample', `${opts.template}.html`);
84
+ }
85
+
86
+ super(deepmerge(defaultOptions, opts));
87
+
88
+ }
89
+
90
+ apply(compiler) {
91
+ super.apply(compiler);
92
+ }
93
+ } // end of class
94
+
95
+
96
+ export default CAWebHTMLPlugin;