chore(rollup): 更新rollup 配置

This commit is contained in:
thinkinggis 2021-02-28 14:53:44 +08:00
parent 21b40b43fd
commit 6a4035e960
4 changed files with 14 additions and 5 deletions

View File

@ -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' ]

View File

@ -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"

View File

@ -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 }

View File

@ -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,