@caweb/webpack 1.3.17 → 1.3.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/changelog.txt +3 -0
- package/package.json +3 -3
- package/plugins/html/changelog.txt +3 -0
- package/plugins/html/package.json +1 -1
- package/plugins/html/sample/default.html +22 -0
- package/plugins/jshint/.customrc +29 -0
- package/plugins/jshint/README.md +1 -3
- package/plugins/jshint/changelog.txt +3 -0
- package/plugins/jshint/index.js +10 -15
- package/plugins/jshint/package-lock.json +23886 -1212
- package/plugins/jshint/package.json +10 -5
- package/plugins/jshint/reporter.cjs +121 -483
- package/plugins/jshint/scripts/webpack.test.js +18 -0
- package/plugins/jshint/sample/jshint.css +0 -247
- package/plugins/jshint/sample/jshint.html +0 -7
- package/plugins/jshint/sample/jshint.js +0 -25
package/changelog.txt
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caweb/webpack",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.18",
|
|
4
4
|
"description": "CAWebPublishing Webpack Configuration",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@caweb/a11y-webpack-plugin": "^1.0.9",
|
|
39
39
|
"@caweb/css-audit-webpack-plugin": "^1.0.12",
|
|
40
|
-
"@caweb/html-webpack-plugin": "^1.5.
|
|
41
|
-
"@caweb/jshint-webpack-plugin": "^
|
|
40
|
+
"@caweb/html-webpack-plugin": "^1.5.19",
|
|
41
|
+
"@caweb/jshint-webpack-plugin": "^2.0.0"
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -9,6 +9,21 @@
|
|
|
9
9
|
<!-- Template Scheme CSS -->
|
|
10
10
|
<link rel="stylesheet" href="node_modules/@caweb/html-webpack-plugin/build/{{ scheme }}.css" />
|
|
11
11
|
{{/if}}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
{{#if htmlWebpackPlugin.options.meta }}
|
|
15
|
+
{{#each htmlWebpackPlugin.options.meta }}
|
|
16
|
+
<meta name="{{ @key }}" content="{{ this }}">
|
|
17
|
+
{{/each}}
|
|
18
|
+
{{/if}}
|
|
19
|
+
|
|
20
|
+
{{#if assets }}
|
|
21
|
+
{{#each assets }}
|
|
22
|
+
{{#if (endsWith this ".css") }}
|
|
23
|
+
<link rel="stylesheet" href="{{ this }}" />
|
|
24
|
+
{{/if}}
|
|
25
|
+
{{/each}}
|
|
26
|
+
{{/if}}
|
|
12
27
|
</head>
|
|
13
28
|
<body>
|
|
14
29
|
{{> header }}
|
|
@@ -27,5 +42,12 @@
|
|
|
27
42
|
{{#if scheme }}
|
|
28
43
|
<script src="node_modules/@caweb/html-webpack-plugin/build/{{ scheme }}.js"></script>
|
|
29
44
|
{{/if}}
|
|
45
|
+
{{#if assets }}
|
|
46
|
+
{{#each assets }}
|
|
47
|
+
{{#if (endsWith this ".js") }}
|
|
48
|
+
<script src="{{ this }}"></script>
|
|
49
|
+
{{/if}}
|
|
50
|
+
{{/each}}
|
|
51
|
+
{{/if}}
|
|
30
52
|
</body>
|
|
31
53
|
</html>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"boss": true,
|
|
3
|
+
"curly": true,
|
|
4
|
+
"eqeqeq": true,
|
|
5
|
+
"eqnull": true,
|
|
6
|
+
"esversion": 11,
|
|
7
|
+
"expr": true,
|
|
8
|
+
"immed": true,
|
|
9
|
+
"noarg": true,
|
|
10
|
+
"nonbsp": true,
|
|
11
|
+
"quotmark": "single",
|
|
12
|
+
"undef": true,
|
|
13
|
+
"unused": true,
|
|
14
|
+
"browser": true,
|
|
15
|
+
"globals": {
|
|
16
|
+
"_": false,
|
|
17
|
+
"Backbone": false,
|
|
18
|
+
"jQuery": false,
|
|
19
|
+
"JSON": false,
|
|
20
|
+
"wp": false,
|
|
21
|
+
"export": false,
|
|
22
|
+
"module": false,
|
|
23
|
+
"require": false,
|
|
24
|
+
"WorkerGlobalScope": false,
|
|
25
|
+
"self": false,
|
|
26
|
+
"OffscreenCanvas": false,
|
|
27
|
+
"Promise": false
|
|
28
|
+
}
|
|
29
|
+
}
|
package/plugins/jshint/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Our standard differs from the guidelines in the following ways:
|
|
|
14
14
|
In your Webpack configuration simply add the plugin to your existing plugin array.
|
|
15
15
|
|
|
16
16
|
<pre>
|
|
17
|
-
import
|
|
17
|
+
import JSHintPlugin from '@caweb/jshint-webpack-plugin';
|
|
18
18
|
|
|
19
19
|
export default {
|
|
20
20
|
plugins: [
|
|
@@ -22,5 +22,3 @@ export default {
|
|
|
22
22
|
]
|
|
23
23
|
}
|
|
24
24
|
</pre>
|
|
25
|
-
|
|
26
|
-
## Options
|
package/plugins/jshint/index.js
CHANGED
|
@@ -73,17 +73,10 @@ class JSHintPlugin {
|
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
options: {
|
|
79
|
-
name: 'jshint.update'
|
|
80
|
-
},
|
|
81
|
-
context: 'jshint'
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const dep = new EntryDependency(entry);
|
|
76
|
+
//const dep = new EntryDependency(path.join( this.config.outputFolder, 'jshint.js'));
|
|
77
|
+
const dep = new EntryDependency(path.resolve( 'src', 'index.js'));
|
|
85
78
|
dep.loc = {
|
|
86
|
-
name:
|
|
79
|
+
name: 'jshint'
|
|
87
80
|
};
|
|
88
81
|
|
|
89
82
|
if( ! fs.existsSync(path.resolve(this.config.outputFolder))){
|
|
@@ -91,7 +84,7 @@ class JSHintPlugin {
|
|
|
91
84
|
}
|
|
92
85
|
|
|
93
86
|
fs.writeFileSync(
|
|
94
|
-
path.join(this.config.outputFolder, `jshint.
|
|
87
|
+
path.join(this.config.outputFolder, `jshint.js`),
|
|
95
88
|
`` // required for hot-update to compile on our page, blank script for now
|
|
96
89
|
);
|
|
97
90
|
|
|
@@ -106,9 +99,11 @@ class JSHintPlugin {
|
|
|
106
99
|
compiler.hooks.make.tapAsync("JSHint Plugin", (compilation, callback) => {
|
|
107
100
|
|
|
108
101
|
compilation.addEntry(
|
|
109
|
-
|
|
102
|
+
'jshint',
|
|
110
103
|
dep,
|
|
111
|
-
|
|
104
|
+
{
|
|
105
|
+
name: 'jshint'
|
|
106
|
+
},
|
|
112
107
|
err => {
|
|
113
108
|
callback(err);
|
|
114
109
|
});
|
|
@@ -136,7 +131,7 @@ class JSHintPlugin {
|
|
|
136
131
|
'string' === typeof s && // is a string and
|
|
137
132
|
0 < s.indexOf('.js') && // has a .js reference and
|
|
138
133
|
0 > s.indexOf('node_modules') && // not referencing node_modules directory
|
|
139
|
-
0 > s.indexOf('jshint.
|
|
134
|
+
0 > s.indexOf('jshint.js') && // not referencing our update javascript
|
|
140
135
|
0 > s.indexOf('a11y.update.js') && // not referencing our a11y javascript
|
|
141
136
|
0 > s.indexOf('audit.update.js') // not referencing our css-audit javascript
|
|
142
137
|
){
|
|
@@ -154,7 +149,7 @@ class JSHintPlugin {
|
|
|
154
149
|
if( result ){
|
|
155
150
|
// we have to inject the jshint.update.js file into the head in order for the webpack-dev-server scripts to load.
|
|
156
151
|
let pageContent = fs.readFileSync(path.join(staticDir.directory, `${this.config.outputFilename}.html`))
|
|
157
|
-
|
|
152
|
+
|
|
158
153
|
fs.writeFileSync(
|
|
159
154
|
path.join(staticDir.directory, `${this.config.outputFilename}.html`),
|
|
160
155
|
pageContent.toString().replace('</head>', `<script src="./jshint.update.js"></script>\n</head>`)
|