@caweb/webpack 1.3.30 → 1.3.32
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/changelog.txt +6 -0
- package/package.json +2 -2
- package/plugins/html/changelog.txt +6 -0
- package/plugins/html/entry/delta.js +1 -3
- package/plugins/html/entry/eureka.js +1 -3
- package/plugins/html/entry/mono.js +1 -3
- package/plugins/html/entry/oceanside.js +1 -3
- package/plugins/html/entry/orangecounty.js +1 -3
- package/plugins/html/entry/pasorobles.js +1 -3
- package/plugins/html/entry/sacramento.js +1 -3
- package/plugins/html/entry/santabarbara.js +1 -3
- package/plugins/html/entry/santacruz.js +1 -3
- package/plugins/html/entry/shasta.js +1 -3
- package/plugins/html/entry/sierra.js +1 -3
- package/plugins/html/entry/trinity.js +1 -3
- package/plugins/html/package-lock.json +1033 -973
- package/plugins/html/package.json +9 -9
- package/plugins/html/scripts/create-entrypoints.js +0 -3
- package/plugins/html/scripts/update-scripts.js +1 -2
- package/plugins/html/webpack.config.js +38 -1
- package/plugins/html/scripts/icon.js +0 -60
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caweb/html-webpack-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "CAWebPublishing Sample Page and Configurations",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -15,9 +15,8 @@
|
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
17
|
"webpack": "webpack",
|
|
18
|
-
"postbuild": "npm run create-entrypoint
|
|
18
|
+
"postbuild": "npm run create-entrypoint",
|
|
19
19
|
"create-entrypoint": "node ./scripts/create-entrypoints.js",
|
|
20
|
-
"generate-json": "node ./scripts/icon.js",
|
|
21
20
|
"update-scripts": "node ./scripts/update-scripts.js",
|
|
22
21
|
"new-scheme": "node ./scripts/schemes.js",
|
|
23
22
|
"remove-scheme": "node ./scripts/schemes.js -r",
|
|
@@ -106,27 +105,28 @@
|
|
|
106
105
|
},
|
|
107
106
|
"homepage": "https://github.com/CAWebPublishing/webpack/plugins/html#readme",
|
|
108
107
|
"devDependencies": {
|
|
109
|
-
"@inquirer/prompts": "^7.
|
|
108
|
+
"@inquirer/prompts": "^7.4.0",
|
|
110
109
|
"animate.css": "^4.1.1",
|
|
111
110
|
"bootstrap": "^5.3.3",
|
|
112
111
|
"bootstrap-forced-colors-css": "^1.0.7",
|
|
113
112
|
"chalk": "^5.4.1",
|
|
114
113
|
"cross-spawn": "^7.0.6",
|
|
115
|
-
"fast-xml-parser": "^5.0.
|
|
116
|
-
"mini-css-extract-plugin": "^2.9.2"
|
|
114
|
+
"fast-xml-parser": "^5.0.9"
|
|
117
115
|
},
|
|
118
116
|
"dependencies": {
|
|
119
117
|
"@caweb/a11y-webpack-plugin": "^1.0.9",
|
|
120
118
|
"@caweb/css-audit-webpack-plugin": "^1.0.12",
|
|
121
119
|
"@caweb/jshint-webpack-plugin": "^2.0.1",
|
|
122
|
-
"@wordpress/scripts": "^30.
|
|
120
|
+
"@wordpress/scripts": "^30.13.0",
|
|
123
121
|
"css-minimizer-webpack-plugin": "^7.0.2",
|
|
124
122
|
"handlebars-loader": "^1.7.3",
|
|
125
123
|
"html-webpack-link-type-plugin": "^1.1.1",
|
|
126
124
|
"html-webpack-plugin": "^5.6.3",
|
|
127
125
|
"html-webpack-skip-assets-plugin": "^1.0.4",
|
|
126
|
+
"mini-css-extract-plugin": "^2.9.2",
|
|
128
127
|
"rtlcss-webpack-plugin": "^4.0.7",
|
|
129
128
|
"webpack": "^5.98.0",
|
|
130
|
-
"webpack-cli": "^6.0.1"
|
|
129
|
+
"webpack-cli": "^6.0.1",
|
|
130
|
+
"webpack-remove-empty-scripts": "^1.0.4"
|
|
131
131
|
}
|
|
132
|
-
}
|
|
132
|
+
}
|
|
@@ -10,7 +10,6 @@ import { fileURLToPath } from 'url';
|
|
|
10
10
|
const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
11
11
|
|
|
12
12
|
let entry = {
|
|
13
|
-
'font-only': path.join(currentPath, 'src', 'styles', 'font-only.css')
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
// create the entry directory
|
|
@@ -25,7 +24,6 @@ let heading = `/**
|
|
|
25
24
|
fs.readdirSync(path.join(currentPath, 'src', 'styles', 'colorschemes')).forEach((c) => {
|
|
26
25
|
let scheme = c.substring(0, c.indexOf('.')).replace(' ', '');
|
|
27
26
|
let files = [
|
|
28
|
-
path.join(currentPath, 'src', 'styles', 'font-only.css'),
|
|
29
27
|
path.join(currentPath, 'src', 'styles', 'colorschemes', c),
|
|
30
28
|
path.join(currentPath, 'src', 'scripts', 'index.js')
|
|
31
29
|
]
|
|
@@ -40,7 +38,6 @@ const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '
|
|
|
40
38
|
|
|
41
39
|
export default {
|
|
42
40
|
entry: {
|
|
43
|
-
'font-only': path.join(currentPath, 'src', 'styles', 'font-only.css'),
|
|
44
41
|
${scheme}: [
|
|
45
42
|
path.join(currentPath, ${correctFiles.join('),\n' + `\t`.repeat(3) + 'path.join(currentPath, ')})
|
|
46
43
|
]
|
|
@@ -11,9 +11,8 @@ const pkg = JSON.parse( fs.readFileSync(path.resolve('package.json')) );
|
|
|
11
11
|
|
|
12
12
|
let scripts = {
|
|
13
13
|
"webpack": "webpack",
|
|
14
|
-
"postbuild": "npm run create-entrypoint
|
|
14
|
+
"postbuild": "npm run create-entrypoint",
|
|
15
15
|
"create-entrypoint": "node ./scripts/create-entrypoints.js",
|
|
16
|
-
"generate-json": "node ./scripts/icon.js",
|
|
17
16
|
"update-scripts": "node ./scripts/update-scripts.js",
|
|
18
17
|
"new-scheme": "node ./scripts/schemes.js",
|
|
19
18
|
"remove-scheme": "node ./scripts/schemes.js -r",
|
|
@@ -20,6 +20,7 @@ import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
|
|
|
20
20
|
import RtlCssPlugin from 'rtlcss-webpack-plugin';
|
|
21
21
|
import {HtmlWebpackSkipAssetsPlugin} from 'html-webpack-skip-assets-plugin';
|
|
22
22
|
import {HtmlWebpackLinkTypePlugin} from 'html-webpack-link-type-plugin';
|
|
23
|
+
import RemoveEmptyScriptsPlugin from 'webpack-remove-empty-scripts';
|
|
23
24
|
|
|
24
25
|
import JSHintPlugin from '@caweb/jshint-webpack-plugin';
|
|
25
26
|
import CSSAuditPlugin from '@caweb/css-audit-webpack-plugin';
|
|
@@ -110,18 +111,33 @@ let webpackConfig = {
|
|
|
110
111
|
mode,
|
|
111
112
|
name: 'uncompressed',
|
|
112
113
|
target: 'web',
|
|
114
|
+
// Turn off caching of generated modules and chunks.
|
|
115
|
+
// @see https://webpack.js.org/configuration/cache/
|
|
113
116
|
cache: false,
|
|
117
|
+
|
|
114
118
|
stats: 'errors',
|
|
119
|
+
|
|
120
|
+
// Determine where the created bundles will be outputted.
|
|
121
|
+
// @see https://webpack.js.org/concepts/#output
|
|
115
122
|
output: {
|
|
116
123
|
...baseConfig.output,
|
|
117
|
-
clean: mode === 'production'
|
|
124
|
+
clean: mode === 'production',
|
|
125
|
+
pathinfo: false
|
|
118
126
|
},
|
|
127
|
+
|
|
119
128
|
performance: {
|
|
120
129
|
maxAssetSize: 500000,
|
|
121
130
|
maxEntrypointSize: 500000
|
|
122
131
|
},
|
|
132
|
+
|
|
133
|
+
// This option determine how different types of module within the project will be treated.
|
|
134
|
+
// @see https://webpack.js.org/configuration/module/
|
|
123
135
|
module:{
|
|
124
136
|
...baseConfig.module,
|
|
137
|
+
// This option sets up loaders for webpack configuration.
|
|
138
|
+
// Loaders allow webpack to process various types because by default webpack only
|
|
139
|
+
// understand JavaScript and JSON files.
|
|
140
|
+
// @see https://webpack.js.org/concepts/#loaders
|
|
125
141
|
rules: [
|
|
126
142
|
...baseConfig.module.rules,
|
|
127
143
|
/**
|
|
@@ -175,6 +191,23 @@ let webpackConfig = {
|
|
|
175
191
|
}
|
|
176
192
|
]
|
|
177
193
|
},
|
|
194
|
+
// WordPress already enqueues scripts and makes them available
|
|
195
|
+
// in global scope so those scripts don't need to be included on the bundle. For webpack
|
|
196
|
+
// to recognize those files, the global variable needs to be registered as externals.
|
|
197
|
+
// These allows global variable listed below to be imported into the module.
|
|
198
|
+
// @see https://webpack.js.org/configuration/externals/#externals
|
|
199
|
+
externals: {
|
|
200
|
+
// Third party dependencies.
|
|
201
|
+
jquery: 'jQuery',
|
|
202
|
+
underscore: '_',
|
|
203
|
+
lodash: 'lodash',
|
|
204
|
+
react: ['vendor', 'React'],
|
|
205
|
+
'react-dom': ['vendor', 'ReactDOM'],
|
|
206
|
+
|
|
207
|
+
// WordPress dependencies.
|
|
208
|
+
'@wordpress/hooks': ['vendor', 'wp', 'hooks'],
|
|
209
|
+
|
|
210
|
+
},
|
|
178
211
|
};
|
|
179
212
|
|
|
180
213
|
/**
|
|
@@ -324,4 +357,8 @@ if( mode === 'production' ){
|
|
|
324
357
|
)
|
|
325
358
|
}
|
|
326
359
|
|
|
360
|
+
// we remove empty scripts
|
|
361
|
+
webpackConfig.plugins.push(
|
|
362
|
+
new RemoveEmptyScriptsPlugin()
|
|
363
|
+
);
|
|
327
364
|
export default webpackConfig;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* External dependencies
|
|
5
|
-
*/
|
|
6
|
-
import fs from 'fs';
|
|
7
|
-
import path from 'path';
|
|
8
|
-
import { fileURLToPath } from 'url';
|
|
9
|
-
|
|
10
|
-
const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
11
|
-
const fontBuildPath = path.join(currentPath, 'build', 'fonts');
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// iterate over all svg files
|
|
15
|
-
fs.readdirSync(fontBuildPath).filter( (e) => e.endsWith('.svg')).forEach((c) => {
|
|
16
|
-
|
|
17
|
-
// we can't use a parser otherwise some of the unicodes will be encoded
|
|
18
|
-
// we parse the file ourselves.
|
|
19
|
-
let svgContent = fs.readFileSync(path.join(fontBuildPath, c)).toString();
|
|
20
|
-
|
|
21
|
-
// we only want the glyph with unicodes
|
|
22
|
-
let icons = [ ...svgContent.matchAll(/glyph unicode=[^\n].*/g) ].map((i) => {
|
|
23
|
-
let raw = i[0];
|
|
24
|
-
let glyph = raw.match(/glyph-name="([\S]+)"/);
|
|
25
|
-
|
|
26
|
-
// only if there is a name associated with the glyph.
|
|
27
|
-
if( glyph ){
|
|
28
|
-
|
|
29
|
-
let unicode = raw.match(/unicode="([\S]+)"/)[1];
|
|
30
|
-
let name = glyph[1];
|
|
31
|
-
let ws = name.replace(/[_-]/g, ' ').split(' ');
|
|
32
|
-
|
|
33
|
-
// the styles is applied by certain editors/builders
|
|
34
|
-
// divi - Applies Divi Theme Support
|
|
35
|
-
// line - Applies Line Styles
|
|
36
|
-
// solid - Applied Solid Styles
|
|
37
|
-
let styles = [
|
|
38
|
-
'divi',
|
|
39
|
-
ws.includes('line') ? 'line' : 'solid'
|
|
40
|
-
]
|
|
41
|
-
|
|
42
|
-
return {
|
|
43
|
-
glyph: name,
|
|
44
|
-
unicode,
|
|
45
|
-
name: ws.map(w => w.charAt(0).toUpperCase() + w.substring(1)).join(' '), // uppercase all words and join with a space
|
|
46
|
-
search_terms: ws.join(' '),
|
|
47
|
-
styles
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}).filter(e=>e); // clear out any null values
|
|
53
|
-
|
|
54
|
-
// write svg json output
|
|
55
|
-
fs.writeFileSync(
|
|
56
|
-
path.join(fontBuildPath, `${c.substring(0, c.lastIndexOf('.'))}.json`),
|
|
57
|
-
JSON.stringify( icons, null, 4 )
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
})
|