antv-l7/packages/three/rollup.config.js

58 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

2020-04-17 10:47:34 +08:00
import pkg from './package.json';
import typescript from 'rollup-plugin-typescript';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import buble from 'rollup-plugin-buble';
import postcss from 'rollup-plugin-postcss';
import { terser } from 'rollup-plugin-terser';
import url from 'postcss-url';
export default {
input: './src/index.ts',
plugins: [
// less(),
typescript({
exclude: 'node_modules/**',
typescript: require('typescript')
}),
resolve({
preferBuiltins: false
}),
postcss({
plugins: [
url({ url: 'inline' })
]
}),
commonjs({
namedExports: {
eventemitter3: [ 'EventEmitter' ],
2021-09-22 17:19:02 +08:00
lodash: [ 'merge' ]
// inversify: [ 'inject', 'injectable' ]
2021-02-28 14:53:44 +08:00
},
dynamicRequireTargets: [
2021-07-03 22:50:25 +08:00
'node_modules/inversify/lib/syntax/binding_{on,when}_syntax.js'
]
2020-04-17 10:47:34 +08:00
}),
buble({
transforms: { generator: false }
}),
terser()
],
external: [
2021-09-22 17:59:47 +08:00
'@antv/l7-core',
'@antv/l7-scene',
'@antv/l7-layers'
2020-04-17 10:47:34 +08:00
],
output: [
{
format: 'umd',
name: 'L7-Three',
file: pkg.unpkg,
sourcemap: true,
globals: {
'@antv/l7': 'L7'
}
}
]
};