From 80c62f5497f8483cb63ce67991deac7bb234ae1b Mon Sep 17 00:00:00 2001 From: cbernat Date: Mon, 30 Aug 2021 16:56:17 -0300 Subject: [PATCH] fix: build errors - [ERR_REQUIRE_ESM]: Must use import to load ES Module: using node 12.20.0 on del-cli module - Minifying images'.' is not recognized as an internal or external command using npx instead of running the module directly --- Dockerfile | 2 +- package.json | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2cc791c5..d22a4b96 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:12.16.3 as source +FROM node:12.20.0 as source WORKDIR /work COPY package-lock.json package.json npm-shrinkwrap.json ./ diff --git a/package.json b/package.json index 2fd43843..fcd4a1e8 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "build": "cross-env-shell ENV=\"dev\" JS=\"main.js --source-map url='main.js.map',includeSources\" SASSMAP=\"--source-map true --source-map-contents true\" MINIFYMAP=\"--source-map --source-map-inline-sources\" OMAP=\"--source-map inline\" npm-run-all del makedir-css makedir-js build-p", "build-p": "run-p font-compile css-compile-all imagemin html js-minify js-copy-push sassdoc", "build-n-serve": "npm-run-all build serve", - "copyfiles": "./node_modules/.bin/cpy", + "copyfiles": "npx cpy", "css-compile": "npm-run-all css-compile-sass-styles css-prefix-styles css-minify-styles csso-styles", "css-compile-all": "npm-run-all css-compile css-compile-editor css-compile-dark csso-dark", "css-compile-dark": "npm-run-all css-compile-sass-dark css-prefix-dark css-minify-dark csso-editor", @@ -59,18 +59,18 @@ "css-prefix-dark": "cross-env-shell npm run css-prefix -- ./$ENV/css/theme-dark.css", "css-prefix-editor": "cross-env-shell npm run css-prefix -- ./$ENV/css/editors.css", "css-prefix-styles": "cross-env-shell npm run css-prefix -- ./$ENV/css/styles.css", - "csso-styles": "cross-env-shell ./node_modules/.bin/csso ./$ENV/css/styles.css --output ./$ENV/css/styles.css $OMAP", - "csso-dark": "cross-env-shell ./node_modules/.bin/csso ./$ENV/css/theme-dark.css --output ./$ENV/css/theme-dark.css $OMAP", - "csso-editor": "cross-env-shell ./node_modules/.bin/csso ./$ENV/css/editors.css --output ./$ENV/css/editors.css $OMAP", + "csso-styles": "cross-env-shell npx csso ./$ENV/css/styles.css --output ./$ENV/css/styles.css $OMAP", + "csso-dark": "cross-env-shell npx csso ./$ENV/css/theme-dark.css --output ./$ENV/css/theme-dark.css $OMAP", + "csso-editor": "cross-env-shell npx csso ./$ENV/css/editors.css --output ./$ENV/css/editors.css $OMAP", "del": "cross-env-shell del-cli ./$ENV", "dist": "cross-env-shell ENV=\"dist\" JS=\"app.js\" npm-run-all font-compile makedir-css css-compile-all imagemin html makedir-js js-minify js-copy-push sassdoc", - "eclint-check": "./node_modules/.bin/eclint check \"**/*\"", - "font": "npm run makedir-font && webfont ./assets/icons/*.svg -d ./assets/fonts -s ./assets/scss/libs/webfont/compiled --font-height 1001 --normalize true", + "eclint-check": "npx eclint check \"**/*\"", + "font": "npm run makedir-font && webfont './assets/icons/*.svg' -d './assets/fonts' -s './assets/scss/libs/webfont/compiled' --font-height 1001 --normalize true", "font-compile": "npm-run-all font font-copy", "font-copy": "cross-env-shell npm run copyfiles ./assets/fonts/*.* ./$ENV/fonts", "html": "cross-env-shell node ./assets/process-html.js $ENV", - "html-processor": "./node_modules/.bin/htmlprocessor", - "imagemin": "cross-env-shell ./node_modules/.bin/imagemin ./assets/img/* --out-dir ./$ENV/img", + "html-processor": "npx htmlprocessor", + "imagemin": "cross-env-shell npx imagemin ./assets/img/* --out-dir ./$ENV/img", "js-copy-push": "cross-env-shell npm run copyfiles ./assets/firebasePush.js ./assets/firebase-messaging-sw.js ./$ENV", "js-minify": "cross-env-shell uglifyjs ./assets/js/*.js --compress --mangle -o $ENV/js/$JS", "makedir-css": "cross-env-shell make-dir ./$ENV/css", @@ -80,7 +80,7 @@ "prettier-check": "prettier-check \"assets/**/*.{css,scss,html}\" \"!assets/scss/libs/**/*.{css,scss}\"", "sassdoc": "cross-env-shell sassdoc ./assets/scss/**/*.* -d ./$ENV/documentation", "semantic-release": "semantic-release", - "serve": "./node_modules/.bin/browser-sync start --server 'dev' -w --files 'dev' --port 3500", + "serve": "npx browser-sync start --server 'dev' -w --files 'dev' --port 3500", "watch": "run-p build-n-serve watch-all", "watch-all": "cross-env-shell ENV=\"dev\" JS=\"main.js --source-map url='main.js.map',includeSources\" run-p watch-js watch-img watch-font watch-sass watch-html", "watch-font": "onchange -k -v \"assets/icons/*.*\" -- cross-env-shell npm run font-compile",