diff options
author | silverwind <me@silverwind.io> | 2021-04-15 13:02:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-15 12:02:34 +0100 |
commit | f7830041f4538633362de6607bbfc8c5f645f0a7 (patch) | |
tree | 60b662b129a96395569aa146593f8c06e8cbcd6f /build | |
parent | 9d07facdebffdd686108ad3b86641b85289d024b (diff) | |
download | gitea-f7830041f4538633362de6607bbfc8c5f645f0a7.tar.gz gitea-f7830041f4538633362de6607bbfc8c5f645f0a7.zip |
Make build scripts compatible with node 12 (#15479)
* Make build scripts compatible with node 12
"fs/promises" is not in node 12, use a more compatible way to import it.
Also, lock major down versions of the image build dependencies to
prevent future surprises.
* add node_modules dependency
Diffstat (limited to 'build')
-rwxr-xr-x | build/generate-images.js | 3 | ||||
-rwxr-xr-x | build/generate-svg.js | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/build/generate-images.js b/build/generate-images.js index d82f21564f..b6616810a7 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 3e14f906e3..72c3be3cbd 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'); |