@caweb/webpack 2.0.3 → 2.0.5
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/helpers/logic/isScheme.js +33 -0
- package/package.json +5 -5
- package/webpack.config.js +0 -16
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export default function isScheme(scheme, options ) {
|
|
2
|
+
let validSchemes = [
|
|
3
|
+
'delta',
|
|
4
|
+
'eureka',
|
|
5
|
+
'mono',
|
|
6
|
+
'oceanside',
|
|
7
|
+
'orangecounty',
|
|
8
|
+
'pasorobles',
|
|
9
|
+
'sacramento',
|
|
10
|
+
'santabarbara',
|
|
11
|
+
'santacruz',
|
|
12
|
+
'shasta',
|
|
13
|
+
'sierra',
|
|
14
|
+
'trinity'
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
let answer = validSchemes.includes(scheme);
|
|
18
|
+
|
|
19
|
+
// if the function is called as a block helper
|
|
20
|
+
// return the answer if true and the options has a fn
|
|
21
|
+
if( options['fn'] && answer ){
|
|
22
|
+
return options.fn(this);
|
|
23
|
+
// if the function is called as a block helper
|
|
24
|
+
// return the answer if false and the options has an inverse
|
|
25
|
+
}else if( options['inverse'] && !answer ){
|
|
26
|
+
return options.inverse(this);
|
|
27
|
+
|
|
28
|
+
// if the function is called as a subexpression
|
|
29
|
+
// return the answer
|
|
30
|
+
}else{
|
|
31
|
+
return answer;
|
|
32
|
+
}
|
|
33
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caweb/webpack",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "CAWebPublishing Webpack Configuration",
|
|
5
5
|
"main": "webpack.config.js",
|
|
6
6
|
"files": [
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"@wordpress/dependency-extraction-webpack-plugin": "^6.40.0",
|
|
44
44
|
"@wordpress/postcss-plugins-preset": "^5.40.0",
|
|
45
45
|
"babel-loader": "^10.0.0",
|
|
46
|
-
"copy-webpack-plugin": "^
|
|
46
|
+
"copy-webpack-plugin": "^14.0.0",
|
|
47
47
|
"css-loader": "^7.1.4",
|
|
48
|
-
"css-minimizer-webpack-plugin": "^
|
|
48
|
+
"css-minimizer-webpack-plugin": "^8.0.0",
|
|
49
49
|
"deepmerge": "^4.3.1",
|
|
50
50
|
"fast-glob": "^3.3.3",
|
|
51
51
|
"handlebars": "^4.7.8",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"html-format": "^1.1.7",
|
|
54
54
|
"html-webpack-plugin": "^5.6.6",
|
|
55
55
|
"mini-css-extract-plugin": "^2.10.0",
|
|
56
|
+
"minimist": "^1.2.8",
|
|
56
57
|
"postcss-loader": "^8.2.1",
|
|
57
58
|
"react-refresh": "^0.18.0",
|
|
58
59
|
"read-package-up": "^12.0.0",
|
|
@@ -64,8 +65,7 @@
|
|
|
64
65
|
"webpack": "^5.105.3",
|
|
65
66
|
"webpack-cli": "^6.0.1",
|
|
66
67
|
"webpack-dev-server": "^5.2.3",
|
|
67
|
-
"webpack-merge": "^6.0.1"
|
|
68
|
-
"webpack-remove-empty-scripts": "^1.1.1"
|
|
68
|
+
"webpack-merge": "^6.0.1"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@wordpress/scripts": "^31.5.0",
|
package/webpack.config.js
CHANGED
|
@@ -18,7 +18,6 @@ import { fileURLToPath } from 'url';
|
|
|
18
18
|
// webpack plugins
|
|
19
19
|
import { merge } from 'webpack-merge';
|
|
20
20
|
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
|
|
21
|
-
import RemoveEmptyScriptsPlugin from 'webpack-remove-empty-scripts';
|
|
22
21
|
|
|
23
22
|
/**
|
|
24
23
|
* Internal dependencies
|
|
@@ -201,21 +200,6 @@ let webpackConfig = {
|
|
|
201
200
|
|
|
202
201
|
},
|
|
203
202
|
|
|
204
|
-
plugins: [
|
|
205
|
-
// we remove empty scripts
|
|
206
|
-
new RemoveEmptyScriptsPlugin(),
|
|
207
|
-
|
|
208
|
-
// certain files can be skipped when serving
|
|
209
|
-
// new HtmlWebpackSkipAssetsPlugin({
|
|
210
|
-
// skipAssets: [
|
|
211
|
-
// /.*-rtl.css/, // we skip the Right-to-Left Styles
|
|
212
|
-
// /css-audit.*/, // we skip the CSSAudit Files
|
|
213
|
-
// /a11y.*/, // we skip the A11y Files
|
|
214
|
-
// /jshint.*/, // we skip the JSHint Files
|
|
215
|
-
// ]
|
|
216
|
-
// }),
|
|
217
|
-
],
|
|
218
|
-
|
|
219
203
|
/**
|
|
220
204
|
* DevServer is only added during 'serve' command
|
|
221
205
|
*
|