diff --git a/Makefile b/Makefile index 7bd479ff6bf1..2cd3d383be57 100644 --- a/Makefile +++ b/Makefile @@ -736,8 +736,8 @@ generate-gitignore: GO111MODULE=on $(GO) run build/generate-gitignores.go .PHONY: generate-images -generate-images: - npm install --no-save --no-package-lock fabric imagemin-zopfli +generate-images: | node_modules + npm install --no-save --no-package-lock fabric@4 imagemin-zopfli@7 node build/generate-images.js $(TAGS) .PHONY: generate-manpage diff --git a/build/generate-images.js b/build/generate-images.js index d82f21564f68..b6616810a76d 100755 --- a/build/generate-images.js +++ b/build/generate-images.js @@ -1,10 +1,11 @@ import imageminZopfli from 'imagemin-zopfli'; import {optimize, extendDefaultPlugins} from 'svgo'; import {fabric} from 'fabric'; -import {readFile, writeFile} from 'fs/promises'; +import fs from 'fs'; import {resolve, dirname} from 'path'; import {fileURLToPath} from 'url'; +const {readFile, writeFile} = fs.promises; const __dirname = dirname(fileURLToPath(import.meta.url)); const logoFile = resolve(__dirname, '../assets/logo.svg'); diff --git a/build/generate-svg.js b/build/generate-svg.js index 3e14f906e30d..72c3be3cbdb7 100755 --- a/build/generate-svg.js +++ b/build/generate-svg.js @@ -1,9 +1,10 @@ import fastGlob from 'fast-glob'; import {optimize, extendDefaultPlugins} from 'svgo'; import {resolve, parse, dirname} from 'path'; -import {readFile, writeFile, mkdir} from 'fs/promises'; +import fs from 'fs'; import {fileURLToPath} from 'url'; +const {readFile, writeFile, mkdir} = fs.promises; const __dirname = dirname(fileURLToPath(import.meta.url)); const glob = (pattern) => fastGlob.sync(pattern, {cwd: resolve(__dirname), absolute: true}); const outputDir = resolve(__dirname, '../public/img/svg');