From 6a4035e960ab51f3a657e1de6a887415616eec73 Mon Sep 17 00:00:00 2001 From: thinkinggis Date: Sun, 28 Feb 2021 14:53:44 +0800 Subject: [PATCH] =?UTF-8?q?chore(rollup):=20=E6=9B=B4=E6=96=B0rollup=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/rollup.config.js | 6 +++++- packages/three/package.json | 2 +- packages/three/rollup.config.js | 8 ++++++-- packages/three/src/core/threeRenderService.ts | 3 ++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/build/rollup.config.js b/build/rollup.config.js index d4b27344ca..0a050092a3 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -72,6 +72,7 @@ module.exports = [ commonjs({ namedExports: { eventemitter3: [ 'EventEmitter' ], + inversify: ['inject','injectable','postConstruct','Container','decorate','interfaces'], // @see https://github.com/rollup/rollup-plugin-commonjs/issues/266 lodash: [ 'isNil', @@ -84,7 +85,10 @@ module.exports = [ 'isNumber', 'merge' ] - } + }, + dynamicRequireTargets: [ + 'node_modules/inversify/lib/syntax/binding_{on,when}_syntax.js', + ], }), babel({ extensions: [ '.js', '.ts' ] diff --git a/packages/three/package.json b/packages/three/package.json index 31bacedf18..6c60c61046 100644 --- a/packages/three/package.json +++ b/packages/three/package.json @@ -34,7 +34,7 @@ "build:cjs": "BABEL_ENV=cjs babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "build:esm": "BABEL_ENV=esm babel src --root-mode upward --out-dir es --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", - "buildcdn": "node_modules/.bin/rollup -c", + "build:cdn": "node_modules/.bin/rollup -c", "lint:ts": "run-p -c lint:ts-*", "test": "jest", "sync": "tnpm sync" diff --git a/packages/three/rollup.config.js b/packages/three/rollup.config.js index 71e2de9e35..b3e8834c5e 100644 --- a/packages/three/rollup.config.js +++ b/packages/three/rollup.config.js @@ -25,8 +25,12 @@ export default { commonjs({ namedExports: { eventemitter3: [ 'EventEmitter' ], - lodash: [ 'merge' ] - } + lodash: [ 'merge' ], + inversify: ['inject','injectable'] + }, + dynamicRequireTargets: [ + 'node_modules/inversify/lib/syntax/binding_{on,when}_syntax.js', + ], }), buble({ transforms: { generator: false } diff --git a/packages/three/src/core/threeRenderService.ts b/packages/three/src/core/threeRenderService.ts index b61b380cea..4525ed8d2d 100644 --- a/packages/three/src/core/threeRenderService.ts +++ b/packages/three/src/core/threeRenderService.ts @@ -1,5 +1,6 @@ -import { IMapService, IMercator, IRendererService, TYPES } from '@antv/l7'; import { inject, injectable } from 'inversify'; +import { IMapService, IMercator, IRendererService, TYPES } from '@antv/l7'; + import { AnimationMixer, Camera,