-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node critical.js #6
Comments
I have the same issue. There is no "index.html" on the build folder. After add ./build.sh
+ uglifycss --output build/style_min.css style.css
+ uglifyjs --output build/script_min.js script.js web_miner/miner.js
+ uglifyjs --output build/worker.js web_miner/worker.js
+ cp web_miner/cn.min.js build/cn.min.js
+ html-minifier --output build/index-raw.html index.html --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --minify-css true --minify-js true
+ node --trace-warnings critical.js
(node:503461) UnhandledPromiseRejectionWarning: Error: ConfigError: "dest" is not allowed
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:96:32)
(node:503461) Error: ConfigError: "dest" is not allowed
(node:503461) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
at emitDeprecationWarning (internal/process/promises.js:180:11)
at processPromiseRejections (internal/process/promises.js:249:13)
at processTicksAndRejections (internal/process/task_queues.js:96:32)
+ rm build/index-raw.html
+ echo OK
OK |
edit critical.js and remove dest like below, it should work // npm i -D critical@latest "use strict"; var critical = require('critical'); critical.generate({ |
I edit critical.js: // npm i -D critical@latest
"use strict";
var critical = require('critical');
critical.generate({
inline: true,
base: 'build',
src: './index-raw.html',
target: './index.html',
minify: false,
width: 1024,
height: 768
}); But, I got the new error: i$ ./build.sh
+ uglifycss --output build/style_min.css style.css
+ uglifyjs --output build/script_min.js script.js web_miner/miner.js
+ uglifyjs --output build/worker.js web_miner/worker.js
+ cp web_miner/cn.min.js build/cn.min.js
+ html-minifier --output build/index-raw.html index.html --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --minify-css true --minify-js true
+ node --trace-warnings critical.js
(node:4357) UnhandledPromiseRejectionWarning: Error: ConfigError: "minify" is not allowed
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:96:32)
(node:4357) Error: ConfigError: "minify" is not allowed
(node:4357) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
at emitDeprecationWarning (internal/process/promises.js:180:11)
at processPromiseRejections (internal/process/promises.js:249:13)
at processTicksAndRejections (internal/process/task_queues.js:96:32)
+ rm build/index-raw.html
+ echo OK
OK Ubuntu 20.04, node v14.17.3 |
in the end, I delete minify from critical.js |
delete minify: false, from critical.js |
When executing build.sh it stuck in line
node critical.js
it throws this error
(node:1300277) UnhandledPromiseRejectionWarning: Error: ConfigError: "dest" is n ot allowed
(node:1300277) UnhandledPromiseRejectionWarning: Unhandled promise rejection. Th is error originated either by throwing inside of an async function without a cat ch block, or by rejecting a promise which was not handled with .catch(). (reject ion id: 1)
(node:1300277) [DEP0018] DeprecationWarning: Unhandled promise rejections are de precated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
The text was updated successfully, but these errors were encountered: