@caweb/css-audit-webpack-plugin 2.1.0 → 2.1.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/index.js +3 -12
  2. package/package.json +4 -4
package/index.js CHANGED
@@ -129,18 +129,9 @@ class CAWebCSSAuditPlugin {
129
129
  compiler.hooks.done.tapAsync(pluginName,
130
130
  (stats, callback) => {
131
131
  console.log('<i> \x1b[32m[webpack-dev-middleware] Running CSS Auditor...\x1b[0m');
132
- /**
133
- * We run the css audit
134
- *
135
- * we scan the output.publicPath if its set and not set to 'auto'
136
- * otherwise we scan the output.path
137
- */
138
- let scanDir = compiler.options.output.publicPath && 'auto' !== compiler.options.output.publicPath ?
139
- compiler.options.output.publicPath :
140
- compiler.options.output.path;
141
-
142
- // get all .css files
143
- let files = fs.readdirSync( scanDir, { recursive: true } ).filter( f => f.endsWith( '.css' ) ).map( f => path.join( scanDir, f ) );
132
+
133
+ // get all .css files in the output directory and subdirectories
134
+ let files = fs.readdirSync( compiler.options.output.path, { recursive: true } ).filter( f => f.endsWith( '.css' ) ).map( f => path.join( compiler.options.output.path, f ) );
144
135
 
145
136
  if( this.audit(files, this.config ) ){
146
137
  console.log(`<i> \x1b[32m[webpack-dev-middleware] CSS Auditor completed successfully. Report can be viewed at \x1b[34m ${new URL(`${auditUrl}${staticDir.publicPath}/${this.config.filename}.html`).toString()}\x1b[0m`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caweb/css-audit-webpack-plugin",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "CAWebPublishing Webpack Plugin to run WordPress CSS Audit",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -40,7 +40,7 @@
40
40
  "test": "echo \"Error: run tests from root\" && exit 0"
41
41
  },
42
42
  "dependencies": {
43
- "@caweb/webpack": "^1.6.3",
43
+ "@caweb/webpack": "^1.6.6",
44
44
  "chalk": "^5.6.2",
45
45
  "cross-spawn": "^7.0.6",
46
46
  "deepmerge": "^4.3.1",
@@ -49,8 +49,8 @@
49
49
  "twig": "^1.17.1"
50
50
  },
51
51
  "devDependencies": {
52
- "@caweb/html-webpack-plugin": "^2.1.0",
53
- "webpack": "^5.104.1",
52
+ "@caweb/html-webpack-plugin": "^2.1.5",
53
+ "webpack": "^5.105.1",
54
54
  "webpack-cli": "^6.0.1"
55
55
  }
56
56
  }