From 58fd0d68bc8b46b23f8cdc65190f08d4e524eb57 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Wed, 28 Nov 2018 12:57:52 +0100 Subject: Fix build chain so that we now have multiple builds. Details below: - svg.js: The esm bundle - svg.min.js: The bundle for all browsers for maximum support - svg.node.js: The bundle for node - polyfill.js: Using svg.min.js requires this polyfill in case the Browser does not understand all of ./config/polyfillList.js - polyfillIE.js: This is required when you use IE11 (polyfill.js still required) Please note, that not all test pass for IE11 due to its rounding issues and wrong calculation of bbox. Also note, that `defaultPrevented` is not working for CustomEvents in IE11. --- package.json | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index 6776214..3c8366e 100644 --- a/package.json +++ b/package.json @@ -11,15 +11,11 @@ "animation" ], "author": "Wout Fierens ", - "main": "dist/svg.js", - "module": "dist/svg.esm.js", - "jam": { - "include": [ - "dist/svg.js", - "README.md", - "LICENSE.txt" - ] - }, + "main": "dist/svg.node.js", + "unpkg": "dist/svg.min.js", + "jsdelivr": "dist/svg.min.js", + "browser": "dist/svg.min.js", + "module": "dist/svg.js", "maintainers": [ { "name": "Wout Fierens", @@ -62,7 +58,9 @@ "server": "npx http-server ./ -d", "test": "npx karma start .config/karma.conf.js", "test:ci": "karma start .config/karma.conf.saucelabs.js", - "build:polyfills": "npx rollup -c .config/rollup.polyfills.js" + "build:polyfills": "npx rollup -c .config/rollup.polyfills.js", + "prepublishOnly": "npm run build && npm run build:polyfills && npm test", + "postPublish": "echo Please upload a zip to the github release containing the dist, license and changelog" }, "devDependencies": { "@babel/core": "^7.1.2", @@ -70,6 +68,8 @@ "@babel/plugin-transform-runtime": "^7.1.0", "@babel/polyfill": "^7.0.0", "@babel/preset-env": "^7.1.0", + "@babel/runtime": "^7.1.5", + "@babel/runtime-corejs2": "^7.1.5", "@target/custom-event-polyfill": "github:Adobe-Marketing-Cloud/custom-event-polyfill", "babel-eslint": "^10.0.1", "core-js": "^2.5.7", @@ -82,6 +82,7 @@ "eslint-plugin-standard": "^4.0.0", "esm": "^3.0.84", "http-server": "^0.11.1", + "innersvg-polyfill": "0.0.2", "jasmine-core": "^3.3.0", "karma": "^3.1.1", "karma-chrome-launcher": "^2.2.0", @@ -98,5 +99,11 @@ "rollup-plugin-uglify": "^6.0.0", "rollup-plugin-uglify-es": "0.0.1", "svgdom": "latest" - } + }, + "browserslist": [ + "last 1 version", + "> 0.25%", + "not maintained node versions", + "not dead" + ] } -- cgit v1.2.3