diff --git a/bundles/all-3.8/package.json b/bundles/all-3.8/package.json index 9789f217..c4ba25e2 100644 --- a/bundles/all-3.8/package.json +++ b/bundles/all-3.8/package.json @@ -47,13 +47,13 @@ "license": "SEE SPINE-LICENSE", "homepage": "https://github.com/pixijs/pixi-spine/#readme", "devDependencies": { - "@pixi-build-tools/rollup-configurator": "^1.0.11", + "@pixi-spine/rollup-config": "~1.0.0", "@pixi-spine/eslint-config": "~1.0.0", "chai": "~4.2.0", "eslint": "~7.13.0", "prepend": "=1.0.2", "rimraf": "3.0.2", - "rollup": "~2.33.1", + "rollup": "^2.53.3", "tslib": "~2.2.0", "typescript": "~4.2.3" } diff --git a/bundles/all-3.8/rollup.config.js b/bundles/all-3.8/rollup.config.js index 54ce568f..90d4eb10 100644 --- a/bundles/all-3.8/rollup.config.js +++ b/bundles/all-3.8/rollup.config.js @@ -1,4 +1,4 @@ -const { main } = require('@pixi-build-tools/rollup-configurator/main'); +const { main } = require('@pixi-spine/rollup-config/main'); const results = main({ globals: { diff --git a/bundles/all-3.8/tsconfig-api.json b/bundles/all-3.8/tsconfig-api.json index 58c626a7..b056500d 100644 --- a/bundles/all-3.8/tsconfig-api.json +++ b/bundles/all-3.8/tsconfig-api.json @@ -2,6 +2,8 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "declaration": true, + "declarationMap": true, "skipLibCheck": true }, "include": [ diff --git a/bundles/all-3.8/tsconfig.json b/bundles/all-3.8/tsconfig.json index e6931824..27042ad9 100644 --- a/bundles/all-3.8/tsconfig.json +++ b/bundles/all-3.8/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "baseUrl": "./", "paths": { "@pixi-spine/*": [ "packages/*/src" diff --git a/bundles/all-4.0/package.json b/bundles/all-4.0/package.json index f04151a5..735e86aa 100644 --- a/bundles/all-4.0/package.json +++ b/bundles/all-4.0/package.json @@ -47,13 +47,13 @@ "license": "SEE SPINE-LICENSE", "homepage": "https://github.com/pixijs/pixi-spine/#readme", "devDependencies": { - "@pixi-build-tools/rollup-configurator": "^1.0.11", + "@pixi-spine/rollup-config": "~1.0.0", "@pixi-spine/eslint-config": "~1.0.0", "chai": "~4.2.0", "eslint": "~7.13.0", "prepend": "=1.0.2", "rimraf": "3.0.2", - "rollup": "~2.33.1", + "rollup": "^2.53.3", "tslib": "~2.2.0", "typescript": "~4.2.3" } diff --git a/bundles/all-4.0/rollup.config.js b/bundles/all-4.0/rollup.config.js index a2614ba2..f8b9175e 100644 --- a/bundles/all-4.0/rollup.config.js +++ b/bundles/all-4.0/rollup.config.js @@ -1,4 +1,4 @@ -const { main } = require('@pixi-build-tools/rollup-configurator/main'); +const { main } = require('@pixi-spine/rollup-config/main'); const results = main({ globals: { diff --git a/bundles/all-4.0/tsconfig-api.json b/bundles/all-4.0/tsconfig-api.json index 58c626a7..b056500d 100644 --- a/bundles/all-4.0/tsconfig-api.json +++ b/bundles/all-4.0/tsconfig-api.json @@ -2,6 +2,8 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "declaration": true, + "declarationMap": true, "skipLibCheck": true }, "include": [ diff --git a/bundles/all-4.0/tsconfig.json b/bundles/all-4.0/tsconfig.json index e6931824..27042ad9 100644 --- a/bundles/all-4.0/tsconfig.json +++ b/bundles/all-4.0/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "baseUrl": "./", "paths": { "@pixi-spine/*": [ "packages/*/src" diff --git a/bundles/pixi-spine/package.json b/bundles/pixi-spine/package.json index cc54e8f1..5902af2e 100644 --- a/bundles/pixi-spine/package.json +++ b/bundles/pixi-spine/package.json @@ -48,13 +48,13 @@ "license": "SEE SPINE-LICENSE", "homepage": "https://github.com/pixijs/pixi-spine/#readme", "devDependencies": { - "@pixi-build-tools/rollup-configurator": "^1.0.11", + "@pixi-spine/rollup-config": "~1.0.0", "@pixi-spine/eslint-config": "~1.0.0", "chai": "~4.2.0", "eslint": "~7.13.0", "prepend": "=1.0.2", "rimraf": "3.0.2", - "rollup": "~2.33.1", + "rollup": "^2.53.3", "tslib": "~2.2.0", "typescript": "~4.2.3" } diff --git a/bundles/pixi-spine/rollup.config.js b/bundles/pixi-spine/rollup.config.js index ee9133da..45a1908a 100644 --- a/bundles/pixi-spine/rollup.config.js +++ b/bundles/pixi-spine/rollup.config.js @@ -1,4 +1,4 @@ -const { main } = require('@pixi-build-tools/rollup-configurator/main'); +const { main } = require('@pixi-spine/rollup-config/main'); const results = main({ globals: { diff --git a/bundles/pixi-spine/tsconfig-api.json b/bundles/pixi-spine/tsconfig-api.json index 58c626a7..b056500d 100644 --- a/bundles/pixi-spine/tsconfig-api.json +++ b/bundles/pixi-spine/tsconfig-api.json @@ -2,6 +2,8 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "declaration": true, + "declarationMap": true, "skipLibCheck": true }, "include": [ diff --git a/bundles/pixi-spine/tsconfig.json b/bundles/pixi-spine/tsconfig.json index e6931824..27042ad9 100644 --- a/bundles/pixi-spine/tsconfig.json +++ b/bundles/pixi-spine/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "baseUrl": "./", "paths": { "@pixi-spine/*": [ "packages/*/src" diff --git a/packages/base/package.json b/packages/base/package.json index a2724901..fa47ec5c 100644 --- a/packages/base/package.json +++ b/packages/base/package.json @@ -18,7 +18,7 @@ "@pixi/utils": "~6.0.2" }, "scripts": { - "build": "rollup -c node_modules/@pixi-build-tools/rollup-configurator/index.js --silent", + "build": "rollup -c node_modules/@pixi-spine/rollup-config/index.js --silent", "build:types": "rimraf compile && tsc -p tsconfig-api.json && api-extractor run && node scripts/injectGlobalMixins" }, "repository": { @@ -42,13 +42,13 @@ "homepage": "https://github.com/pixijs/pixi-spine/#readme", "devDependencies": { "@microsoft/api-extractor": "7.13.5", - "@pixi-build-tools/rollup-configurator": "^1.0.11", "@pixi-spine/eslint-config": "~1.0.0", + "@pixi-spine/rollup-config": "~1.0.0", "chai": "~4.2.0", "eslint": "~7.13.0", "prepend": "=1.0.2", "rimraf": "3.0.2", - "rollup": "~2.33.1", + "rollup":"^2.53.3", "tslib": "~2.2.0", "typescript": "~4.2.3" } diff --git a/packages/base/tsconfig-api.json b/packages/base/tsconfig-api.json index 58c626a7..e71dc1af 100644 --- a/packages/base/tsconfig-api.json +++ b/packages/base/tsconfig-api.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", - "skipLibCheck": true + "declaration": true, + "declarationMap": true }, "include": [ "src/*.ts" diff --git a/packages/base/tsconfig.json b/packages/base/tsconfig.json index e6931824..27042ad9 100644 --- a/packages/base/tsconfig.json +++ b/packages/base/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "baseUrl": "./", "paths": { "@pixi-spine/*": [ "packages/*/src" diff --git a/packages/loader-3.8/package.json b/packages/loader-3.8/package.json index f0cbd2c4..ee730fd7 100644 --- a/packages/loader-3.8/package.json +++ b/packages/loader-3.8/package.json @@ -45,11 +45,12 @@ "devDependencies": { "@pixi-build-tools/rollup-configurator": "^1.0.11", "@pixi-spine/eslint-config": "~1.0.0", + "@pixi-spine/rollup-config": "~1.0.0", "chai": "~4.2.0", "eslint": "~7.13.0", "prepend": "=1.0.2", "rimraf": "3.0.2", - "rollup": "~2.33.1", + "rollup": "^2.53.3", "tslib": "~2.2.0", "typescript": "~4.2.3" } diff --git a/packages/loader-3.8/rollup.config.js b/packages/loader-3.8/rollup.config.js index c60ef8e7..07ced353 100644 --- a/packages/loader-3.8/rollup.config.js +++ b/packages/loader-3.8/rollup.config.js @@ -1,4 +1,4 @@ -const { main } = require('@pixi-build-tools/rollup-configurator/main'); +const {main} = require('@pixi-spine/rollup-config/main'); module.exports = main({ globals: { @@ -7,3 +7,6 @@ module.exports = main({ '@pixi-spine/loader-base': 'PIXI.spine', }, }); + + + diff --git a/packages/loader-3.8/tsconfig-api.json b/packages/loader-3.8/tsconfig-api.json index 58c626a7..b056500d 100644 --- a/packages/loader-3.8/tsconfig-api.json +++ b/packages/loader-3.8/tsconfig-api.json @@ -2,6 +2,8 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "declaration": true, + "declarationMap": true, "skipLibCheck": true }, "include": [ diff --git a/packages/loader-3.8/tsconfig.json b/packages/loader-3.8/tsconfig.json index e6931824..27042ad9 100644 --- a/packages/loader-3.8/tsconfig.json +++ b/packages/loader-3.8/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "baseUrl": "./", "paths": { "@pixi-spine/*": [ "packages/*/src" diff --git a/packages/loader-4.0/package.json b/packages/loader-4.0/package.json index 3e8eb44a..2045a737 100644 --- a/packages/loader-4.0/package.json +++ b/packages/loader-4.0/package.json @@ -43,13 +43,13 @@ }, "homepage": "https://github.com/pixijs/pixi-spine/#readme", "devDependencies": { - "@pixi-build-tools/rollup-configurator": "^1.0.11", "@pixi-spine/eslint-config": "~1.0.0", + "@pixi-spine/rollup-config": "~1.0.0", "chai": "~4.2.0", "eslint": "~7.13.0", "prepend": "=1.0.2", "rimraf": "3.0.2", - "rollup": "~2.33.1", + "rollup":"^2.53.3", "tslib": "~2.2.0", "typescript": "~4.2.3" } diff --git a/packages/loader-4.0/rollup.config.js b/packages/loader-4.0/rollup.config.js index c60ef8e7..6e7455ef 100644 --- a/packages/loader-4.0/rollup.config.js +++ b/packages/loader-4.0/rollup.config.js @@ -1,4 +1,4 @@ -const { main } = require('@pixi-build-tools/rollup-configurator/main'); +const {main} = require('@pixi-spine/rollup-config/main'); module.exports = main({ globals: { diff --git a/packages/loader-4.0/tsconfig-api.json b/packages/loader-4.0/tsconfig-api.json index 58c626a7..b056500d 100644 --- a/packages/loader-4.0/tsconfig-api.json +++ b/packages/loader-4.0/tsconfig-api.json @@ -2,6 +2,8 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "declaration": true, + "declarationMap": true, "skipLibCheck": true }, "include": [ diff --git a/packages/loader-4.0/tsconfig.json b/packages/loader-4.0/tsconfig.json index e6931824..27042ad9 100644 --- a/packages/loader-4.0/tsconfig.json +++ b/packages/loader-4.0/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "baseUrl": "./", "paths": { "@pixi-spine/*": [ "packages/*/src" diff --git a/packages/loader-base/package.json b/packages/loader-base/package.json index 61f729c8..7774225d 100644 --- a/packages/loader-base/package.json +++ b/packages/loader-base/package.json @@ -42,13 +42,13 @@ }, "homepage": "https://github.com/pixijs/pixi-spine/#readme", "devDependencies": { - "@pixi-build-tools/rollup-configurator": "^1.0.11", + "@pixi-spine/rollup-config": "~1.0.0", "@pixi-spine/eslint-config": "~1.0.0", "chai": "~4.2.0", "eslint": "~7.13.0", "prepend": "=1.0.2", "rimraf": "3.0.2", - "rollup": "~2.33.1", + "rollup": "^2.53.3", "tslib": "~2.2.0", "typescript": "~4.2.3" } diff --git a/packages/loader-base/rollup.config.js b/packages/loader-base/rollup.config.js index 28974866..71cbae50 100644 --- a/packages/loader-base/rollup.config.js +++ b/packages/loader-base/rollup.config.js @@ -1,7 +1,7 @@ -const { main } = require('@pixi-build-tools/rollup-configurator/main'); +const {main} = require('@pixi-spine/rollup-config/main'); module.exports = main({ globals: { - '@pixi-spine/base': 'PIXI.spine' + '@pixi-spine/base': 'PIXI.spine', }, }); diff --git a/packages/loader-base/tsconfig-api.json b/packages/loader-base/tsconfig-api.json index 58c626a7..b056500d 100644 --- a/packages/loader-base/tsconfig-api.json +++ b/packages/loader-base/tsconfig-api.json @@ -2,6 +2,8 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "declaration": true, + "declarationMap": true, "skipLibCheck": true }, "include": [ diff --git a/packages/loader-base/tsconfig.json b/packages/loader-base/tsconfig.json index e6931824..27042ad9 100644 --- a/packages/loader-base/tsconfig.json +++ b/packages/loader-base/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "baseUrl": "./", "paths": { "@pixi-spine/*": [ "packages/*/src" diff --git a/packages/loader-uni/package.json b/packages/loader-uni/package.json index c41fa93d..d7f6d47f 100644 --- a/packages/loader-uni/package.json +++ b/packages/loader-uni/package.json @@ -40,13 +40,13 @@ }, "homepage": "https://github.com/pixijs/pixi-spine/#readme", "devDependencies": { - "@pixi-build-tools/rollup-configurator": "^1.0.11", + "@pixi-spine/rollup-config": "~1.0.0", "@pixi-spine/eslint-config": "~1.0.0", "chai": "~4.2.0", "eslint": "~7.13.0", "prepend": "=1.0.2", "rimraf": "3.0.2", - "rollup": "~2.33.1", + "rollup": "^2.53.3", "tslib": "~2.2.0", "typescript": "~4.2.3" } diff --git a/packages/loader-uni/rollup.config.js b/packages/loader-uni/rollup.config.js index 24bd70b3..137ad9b4 100644 --- a/packages/loader-uni/rollup.config.js +++ b/packages/loader-uni/rollup.config.js @@ -1,4 +1,4 @@ -const { main } = require('@pixi-build-tools/rollup-configurator/main'); +const {main} = require('@pixi-spine/rollup-config/main'); module.exports = main({ globals: { diff --git a/packages/loader-uni/tsconfig-api.json b/packages/loader-uni/tsconfig-api.json index 58c626a7..b056500d 100644 --- a/packages/loader-uni/tsconfig-api.json +++ b/packages/loader-uni/tsconfig-api.json @@ -2,6 +2,8 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "declaration": true, + "declarationMap": true, "skipLibCheck": true }, "include": [ diff --git a/packages/loader-uni/tsconfig.json b/packages/loader-uni/tsconfig.json index e6931824..27042ad9 100644 --- a/packages/loader-uni/tsconfig.json +++ b/packages/loader-uni/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "baseUrl": "./", "paths": { "@pixi-spine/*": [ "packages/*/src" diff --git a/packages/runtime-3.7/package.json b/packages/runtime-3.7/package.json index 3ab6be7b..62598993 100644 --- a/packages/runtime-3.7/package.json +++ b/packages/runtime-3.7/package.json @@ -39,12 +39,12 @@ "license": "SEE SPINE-LICENSE", "homepage": "https://github.com/pixijs/pixi-spine/#readme", "devDependencies": { - "@pixi-build-tools/rollup-configurator": "^1.0.11", + "@pixi-spine/rollup-config": "~1.0.0", "@pixi-spine/eslint-config": "~1.0.0", "chai": "~4.2.0", "eslint": "~7.13.0", "rimraf": "3.0.2", - "rollup": "~2.33.1", + "rollup": "^2.53.3", "tslib": "~2.2.0", "typescript": "~4.2.3" } diff --git a/packages/runtime-3.7/rollup.config.js b/packages/runtime-3.7/rollup.config.js index 3aa68cdd..71cbae50 100644 --- a/packages/runtime-3.7/rollup.config.js +++ b/packages/runtime-3.7/rollup.config.js @@ -1,4 +1,4 @@ -const { main } = require('@pixi-build-tools/rollup-configurator/main'); +const {main} = require('@pixi-spine/rollup-config/main'); module.exports = main({ globals: { diff --git a/packages/runtime-3.7/tsconfig-api.json b/packages/runtime-3.7/tsconfig-api.json index 7a261b8c..e71dc1af 100644 --- a/packages/runtime-3.7/tsconfig-api.json +++ b/packages/runtime-3.7/tsconfig-api.json @@ -1,7 +1,9 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "compile" + "outDir": "compile", + "declaration": true, + "declarationMap": true }, "include": [ "src/*.ts" diff --git a/packages/runtime-3.7/tsconfig.json b/packages/runtime-3.7/tsconfig.json index e6931824..27042ad9 100644 --- a/packages/runtime-3.7/tsconfig.json +++ b/packages/runtime-3.7/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "baseUrl": "./", "paths": { "@pixi-spine/*": [ "packages/*/src" diff --git a/packages/runtime-3.8/package.json b/packages/runtime-3.8/package.json index 9adcf71b..7497249d 100644 --- a/packages/runtime-3.8/package.json +++ b/packages/runtime-3.8/package.json @@ -39,13 +39,13 @@ "license": "SEE SPINE-LICENSE", "homepage": "https://github.com/pixijs/pixi-spine/#readme", "devDependencies": { - "@pixi-build-tools/rollup-configurator": "^1.0.11", - "@pixi-spine/eslint-config": "~1.0.0", - "chai": "~4.2.0", - "eslint": "~7.13.0", - "rimraf": "3.0.2", - "rollup": "~2.33.1", - "tslib": "~2.2.0", - "typescript": "~4.2.3" + "@pixi-spine/rollup-config": "~1.0.0", + "@pixi-spine/eslint-config": "~1.0.0", + "chai": "~4.2.0", + "eslint": "~7.13.0", + "rimraf": "3.0.2", + "rollup": "^2.53.3", + "tslib": "~2.2.0", + "typescript": "~4.2.3" } } diff --git a/packages/runtime-3.8/rollup.config.js b/packages/runtime-3.8/rollup.config.js index 2185966a..8b1fc303 100644 --- a/packages/runtime-3.8/rollup.config.js +++ b/packages/runtime-3.8/rollup.config.js @@ -1,4 +1,4 @@ -const { main } = require('@pixi-build-tools/rollup-configurator/main'); +const {main} = require('@pixi-spine/rollup-config/main'); module.exports = main({ globals: { diff --git a/packages/runtime-3.8/tsconfig-api.json b/packages/runtime-3.8/tsconfig-api.json index 7a261b8c..e71dc1af 100644 --- a/packages/runtime-3.8/tsconfig-api.json +++ b/packages/runtime-3.8/tsconfig-api.json @@ -1,7 +1,9 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "compile" + "outDir": "compile", + "declaration": true, + "declarationMap": true }, "include": [ "src/*.ts" diff --git a/packages/runtime-3.8/tsconfig.json b/packages/runtime-3.8/tsconfig.json index e6931824..27042ad9 100644 --- a/packages/runtime-3.8/tsconfig.json +++ b/packages/runtime-3.8/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "baseUrl": "./", "paths": { "@pixi-spine/*": [ "packages/*/src" diff --git a/packages/runtime-4.0/package.json b/packages/runtime-4.0/package.json index 43ddb244..8ce9c935 100644 --- a/packages/runtime-4.0/package.json +++ b/packages/runtime-4.0/package.json @@ -39,12 +39,12 @@ "license": "SEE SPINE-LICENSE", "homepage": "https://github.com/pixijs/pixi-spine/#readme", "devDependencies": { - "@pixi-build-tools/rollup-configurator": "^1.0.11", + "@pixi-spine/rollup-config": "~1.0.0", "@pixi-spine/eslint-config": "~1.0.0", "chai": "~4.2.0", "eslint": "~7.13.0", "rimraf": "3.0.2", - "rollup": "~2.33.1", + "rollup": "^2.53.3", "tslib": "~2.2.0", "typescript": "~4.2.3" } diff --git a/packages/runtime-4.0/rollup.config.js b/packages/runtime-4.0/rollup.config.js index 2185966a..8b1fc303 100644 --- a/packages/runtime-4.0/rollup.config.js +++ b/packages/runtime-4.0/rollup.config.js @@ -1,4 +1,4 @@ -const { main } = require('@pixi-build-tools/rollup-configurator/main'); +const {main} = require('@pixi-spine/rollup-config/main'); module.exports = main({ globals: { diff --git a/packages/runtime-4.0/tsconfig-api.json b/packages/runtime-4.0/tsconfig-api.json index 7a261b8c..e71dc1af 100644 --- a/packages/runtime-4.0/tsconfig-api.json +++ b/packages/runtime-4.0/tsconfig-api.json @@ -1,7 +1,9 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "compile" + "outDir": "compile", + "declaration": true, + "declarationMap": true }, "include": [ "src/*.ts" diff --git a/packages/runtime-4.0/tsconfig.json b/packages/runtime-4.0/tsconfig.json index e6931824..27042ad9 100644 --- a/packages/runtime-4.0/tsconfig.json +++ b/packages/runtime-4.0/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "compile", + "baseUrl": "./", "paths": { "@pixi-spine/*": [ "packages/*/src" diff --git a/rush.json b/rush.json index 2f38dd56..3d83c1f6 100644 --- a/rush.json +++ b/rush.json @@ -92,6 +92,12 @@ "projectFolder": "tools/eslint-config", "reviewCategory": "production", "shouldPublish": false + }, + { + "packageName": "@pixi-spine/rollup-config", + "projectFolder": "tools/rollup-config", + "reviewCategory": "production", + "shouldPublish": false } ] } diff --git a/tools/rollup-config/index.js b/tools/rollup-config/index.js new file mode 100644 index 00000000..6be2880d --- /dev/null +++ b/tools/rollup-config/index.js @@ -0,0 +1,2 @@ +const {main} = require('./main.js'); +module.exports = main({}); diff --git a/tools/rollup-config/main.js b/tools/rollup-config/main.js new file mode 100644 index 00000000..05f570e6 --- /dev/null +++ b/tools/rollup-config/main.js @@ -0,0 +1,199 @@ +// copied @pixi-build-tools/rollup-configurator, added plugin-typescript + +const fs = require('fs'); +const path = require('path'); +const {globals} = require('@pixi-build-tools/globals'); +const resolve = require('rollup-plugin-node-resolve'); + +const string = require('rollup-plugin-string').string; +const sourcemaps = require('rollup-plugin-sourcemaps'); +const commonjs = require('@rollup/plugin-commonjs'); +const replace = require('rollup-plugin-replace'); +const {terser} = require('rollup-plugin-terser'); +const typescript = require('@rollup/plugin-typescript'); + +const projectFolder = process.cwd(); +const packageJsonPath = path.relative(__dirname, path.join(projectFolder, './package.json')); + +const pkg = require(packageJsonPath); +const pkgName = pkg.name; +const pkgAuthor = pkg.author; + +exports.main = function main(options) { + options = Object.assign({ + sourcemap: true, + globals: {}, + production: false, + }, options); + + const plugins = [ + resolve({ + browser: true, + preferBuiltins: false, + }), + string({ + include: [ + '**/*.frag', + '**/*.vert', + ], + }), + replace({ + __VERSION__: pkg.version, + }), + typescript({ + tsconfig: path.relative(__dirname, path.join(projectFolder, './tsconfig.json')), + }), + sourcemaps(), + commonjs({}), + ]; + + const compiled = (new Date()).toUTCString() + .replace(/GMT/g, 'UTC'); + let banner = [ + `/* eslint-disable */`, + ` `, + `/*!`, + ` * ${pkg.name} - v${pkg.version}`, + ` * Compiled ${compiled}`, + ` *`, + ` * ${pkg.name} is licensed under the MIT License.`, + ` * http://www.opensource.org/licenses/mit-license`, + ` * `, + ` * Copyright 2019-2020, ${pkg.author}, All Rights Reserved`, + ` */`, + ].join('\n'); + + const { + main, + module, + bundle, + bundleInput, + bundleOutput, + bundleNoExports, + namespace, + standalone, + peerDependencies, + dependencies, + } = pkg; + + let input = options.input; + + if (!input) { + const indexTs = path.join(projectFolder, 'src/index.ts'); + + if (fs.existsSync(indexTs)) { + input = indexTs; + } + } + if (!input) { + const indexJs = path.join(projectFolder, 'src/index.js'); + + if (fs.existsSync(indexJs)) { + input = indexJs; + } + } + if (!input) { + throw new Error(`Unable to resolve entry file: /src/index.(js|ts) do not exist?`); + } + + const external = [] + .concat(options.external || []) + .concat(Object.keys(pkg.peerDependencies || {})) + .concat(Object.keys(pkg.dependencies || {})) + .filter((pkg) => !options.excludedExternals?.includes(pkg)); + + const config = { + plugins, + external, + input, + output: [], + }; + + if (options.main || main) { + config.output.push({ + banner, + file: path.join(projectFolder, options.main || main), + format: 'cjs', + sourcemap: options.sourcemap, + }); + } + if (options.module || module) { + config.output.push({ + banner, + file: path.join(projectFolder, options.module || module), + format: 'esm', + sourcemap: options.sourcemap, + }); + } + + if (!options.bundle && !bundle) { + // No UMD bundle, we're done! + return [config]; + } + + const results = [config]; + const name = pkg.name.replace(/[^a-z]+/g, '_'); + const ns = namespace || 'PIXI'; + + // Assign to namespace + let footer; + + // Standalone packages do not export anything into a namespace + if (!standalone) { + if (bundleNoExports !== true) { + footer = `if (typeof ${name} !== 'undefined') { Object.assign(this.${ns}, ${name}); }`; + } + + // Allow namespaces upto 2-depth (like PIXI.tilemap) + if (ns.includes('.')) { + const base = ns.split('.')[0]; + + banner += `\nthis.${base} = this.${base} || {};`; + } + + banner += `\nthis.${ns} = this.${ns} || {};`; + } + + const file = path.join(projectFolder, options.bundle || bundle); + + results.push({ + input, + external, + output: Object.assign({ + banner, + file, + format: 'umd', + globals: {...globals, ...options.globals}, + name, + footer, + sourcemap: options.sourcemap, + }, bundleOutput), + treeshake: false, + plugins, + }); + + if (process.env.NODE_ENV === 'production' || options.production) { + results.push({ + input, + external, + output: Object.assign({ + banner, + file: file.replace(/\.js$/, '.min.js'), + format: 'umd', + globals: {...globals, ...options.globals}, + name, + footer, + sourcemap: options.sourcemap, + }, bundleOutput), + treeshake: false, + plugins: [...plugins, terser({ + output: { + comments: (node, comment) => comment.line === 1, + }, + })], + }); + } + + return results; +}; + diff --git a/tools/rollup-config/package.json b/tools/rollup-config/package.json new file mode 100644 index 00000000..ba238c61 --- /dev/null +++ b/tools/rollup-config/package.json @@ -0,0 +1,33 @@ +{ + "name": "@pixi-spine/rollup-config", + "version": "1.0.0", + "description": "ESLint config for pixi-spine", + "main": "index.js", + "scripts": { + "build": "echo @pixi-spine/rollup-config does not build!", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/pixijs/pixi-spine.git" + }, + "keywords": [ + "pixi-spine", + "eslint-config" + ], + "author": "Ivan Igorevich Popelyshev ", + "bugs": { + "url": "https://github.com/pixijs/pixi-spine/issues" + }, + "homepage": "https://github.com/pixijs/pixi-spine/#readme", + "dependencies": { + "@pixi-build-tools/globals": "^1.0.6", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-string": "^3.0.0", + "rollup-plugin-sourcemaps": "^0.6.3", + "@rollup/plugin-commonjs": "^19.0.1", + "rollup-plugin-replace": "^2.2.0", + "rollup-plugin-terser": "^7.0.2", + "@rollup/plugin-typescript": "^8.2.3" + } +} diff --git a/tsconfig.json b/tsconfig.json index 5f624275..b6b5c870 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es6", + "target": "es5", "allowJs": true, "sourceMap": true, "removeComments": false, @@ -14,9 +14,10 @@ "moduleResolution": "node", "baseUrl": "./", "outDir": "./compile", - "declaration": true, - "declarationMap": true, - "allowSyntheticDefaultImports": true + "declaration": false, + "declarationMap": false, + "allowSyntheticDefaultImports": true, + "lib": ["es6", "dom"], }, "exclude": [ "node_modules",