Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ rules:
- allowEmptyCatch: true
no-prototype-builtins: 'off'
"node/no-extraneous-require": 'off'
"node/no-unsupported-features/es-syntax": 'error'
"node/no-unsupported-features/es-syntax": ['error', {'ignores': ['dynamicImport']}]
10 changes: 5 additions & 5 deletions modules/analyzeCss/analyzeCss.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ module.exports = function (phantomas) {
return;
}

// load analyze-css module
// https://www.npmjs.com/package/analyze-css
const analyzer = require("analyze-css");
phantomas.log("Using version %s", analyzer.version);

phantomas.setMetric("cssParsingErrors"); // @desc number of CSS files (or embeded CSS) that failed to be parse by analyze-css @optional
phantomas.setMetric("cssInlineStyles"); // @desc number of inline styles @optional

Expand Down Expand Up @@ -92,6 +87,11 @@ module.exports = function (phantomas) {
}
**/

// load analyze-css module
// https://www.npmjs.com/package/analyze-css
const analyzer = (await import("analyze-css")).default;
phantomas.log("Using version %s", analyzer.version);

// https://www.npmjs.com/package/analyze-css#commonjs-module
var options = {};
let results;
Expand Down