From 5badb4fceae7d1c820ad993935bd33143b10ad16 Mon Sep 17 00:00:00 2001 From: yushijinhun Date: Thu, 23 Jan 2020 00:33:57 +0800 Subject: [PATCH] Include separate modules in build output https://github.com/bs-community/skinview3d/pull/45#issuecomment-575554703 --- .gitignore | 1 + package.json | 11 ++++++----- rollup.config.js | 10 +--------- tsconfig.json | 1 - 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 2c1d5c3..4bf852f 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,7 @@ typings/ .env dist/ +jsm/ _ignore/ dist/ .DS_Store diff --git a/package.json b/package.json index b9d3f1f..a373243 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,12 @@ "name": "skinview3d", "version": "1.2.1", "description": "Three.js powered Minecraft skin viewer", - "module": "dist/skinview3d.module.js", - "main": "dist/skinview3d.js", + "module": "jsm/skinview3d.js", + "main": "dist/skinview3d.min.js", "scripts": { - "build": "rollup -c", + "build": "rollup -c && tsc -p . --outDir jsm --declaration", "test": "npm run lint", - "prepublishOnly": "rimraf dist && npm run build", + "prepublishOnly": "rimraf dist jsm && npm run build", "lint": "eslint --ext .ts src/", "dev": "npm-run-all --parallel watch serve", "watch": "rollup -w -c", @@ -30,7 +30,8 @@ }, "homepage": "https://github.com/bs-community/skinview3d", "files": [ - "dist" + "dist", + "jsm" ], "dependencies": { "three": "^0.112.1", diff --git a/rollup.config.js b/rollup.config.js index 9c8dc32..f86d2c3 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -12,11 +12,6 @@ const umd = { } }; -const es = { - format: "es", - indent: "\t" -}; - const licensePlugin = license({ banner: ` skinview3d (https://github.com/bs-community/skinview3d) @@ -35,10 +30,7 @@ const base = { export default [ { ...base, - output: [ - { ...umd, file: "dist/skinview3d.js" }, - { ...es, file: "dist/skinview3d.module.js" } - ], + output: { ...umd, file: "dist/skinview3d.js" }, plugins: [ resolve(), typescript(), diff --git a/tsconfig.json b/tsconfig.json index 8926c9d..d9d6a6f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,6 @@ "module": "es2015", "moduleResolution": "node", "target": "es5", - "declaration": true, "strict": true, "noImplicitAny": false, "strictFunctionTypes": false