mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
feat: setup universal browser and node builds
In this diff I fixed es modules distribution for bundlers. Before we had two problems - bundlers use "module" field to find es module build - bundlers cannot use provided es module with node target In this diff I addressed both of them. Now "main" and "module" fields points to "node" specific versions. "browser" field provides aliases with browser compatible builds. All modern browsers support both "module" and "browser" fields.
This commit is contained in:
+8
-4
@@ -2,9 +2,13 @@
|
||||
"name": "liquidjs",
|
||||
"version": "9.13.0",
|
||||
"description": "A simple, expressive, safe and Shopify compatible template engine in pure JavaScript.",
|
||||
"main": "dist/liquid.cjs.js",
|
||||
"es2015": "dist/liquid.esm.js",
|
||||
"browser": "dist/liquid.js",
|
||||
"main": "dist/liquid.node.cjs.js",
|
||||
"module": "dist/liquid.node.esm.js",
|
||||
"es2015": "dist/liquid.browser.esm.js",
|
||||
"browser": {
|
||||
"./dist/liquid.node.cjs.js": "./dist/liquid.browser.umd.js",
|
||||
"./dist/liquid.node.esm.js": "./dist/liquid.browser.esm.js"
|
||||
},
|
||||
"types": "dist/liquid.d.ts",
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
@@ -16,7 +20,7 @@
|
||||
"benchmark": "node --expose-gc benchmark/index",
|
||||
"coverage": "nyc --reporter=html mocha \"test/{unit,integration}/**/*.ts\"",
|
||||
"coverage-coveralls": "nyc mocha \"test/{unit,integration}/**/*.ts\" && nyc report --reporter=text-lcov | coveralls",
|
||||
"build": "rollup -c rollup.config.ts && ls -lh dist",
|
||||
"build": "rm -rf dist && rollup -c rollup.config.ts && ls -lh dist",
|
||||
"build-docs": "bin/build-docs.sh",
|
||||
"watch": "tsc --watch"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user