Skip to content

Commit

Permalink
perf: target Node.js 14 for cjs bundle (main entry)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: main entry need Node.js>=14 to run, you can build LiquidJS by your own by using ESM entry.
  • Loading branch information
harttle committed Nov 17, 2022
1 parent 96911f0 commit 09deefb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -73,7 +73,7 @@ const nodeEsm = {
format: 'esm',
banner
}],
external: ['path', 'fs'],
external: ['path', 'fs', 'stream'],
plugins: [
versionInjection,
replace(esmRequire),
Expand Down
2 changes: 1 addition & 1 deletion src/liquid-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 09deefb

Please sign in to comment.