perf: target Node.js 14 for cjs bundle (main entry)

BREAKING CHANGE: main entry need Node.js>=14 to run, you can build LiquidJS by your own by using ESM entry.
This commit is contained in:
Jun Yang
2022-11-27 14:04:01 +08:00
parent 7eb621601c
commit 1f6ce7c822
3 changed files with 7 additions and 4 deletions
+3
View File
@@ -10,6 +10,9 @@
"./dist/liquid.node.esm.js": "./dist/liquid.browser.esm.js"
},
"types": "dist/liquid.d.ts",
"engines": {
"node": ">=14"
},
"scripts": {
"lint": "eslint \"**/*.mjs\" \"**/*.ts\" .",
"check": "npm run build && npm test && npm run lint && npm run perf:diff",
+3 -3
View File
@@ -61,8 +61,8 @@ const nodeCjs = {
format: 'cjs',
banner
}],
external: ['path', 'fs'],
plugins: [versionInjection, typescript(tsconfig('es5'))],
external: ['path', 'fs', 'stream'],
plugins: [versionInjection, typescript(tsconfig('ES2020'))],
treeshake,
input
}
@@ -73,7 +73,7 @@ const nodeEsm = {
format: 'esm',
banner
}],
external: ['path', 'fs'],
external: ['path', 'fs', 'stream'],
plugins: [
versionInjection,
replace(esmRequire),
+1 -1
View File
@@ -5,7 +5,7 @@ import { FS } from './fs/fs'
import * as fs from './fs/node'
import { defaultOperators, Operators } from './render/operator'
import { filters } from './filters'
import { assert } from './types'
import { assert } from './util/assert'
type OutputEscape = (value: any) => string
type OutputEscapeOption = 'escape' | 'json' | OutputEscape