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

52 lines
1.0 KiB
JavaScript
Raw Normal View History

2020-03-20 11:13:58 +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';
2020-04-07 20:18:43 +08:00
import postcss from 'rollup-plugin-postcss';
import { terser } from 'rollup-plugin-terser';
import url from 'postcss-url';
2020-03-20 11:13:58 +08:00
export default {
input: './src/index.ts',
plugins: [
2020-04-07 20:18:43 +08:00
// less(),
2020-03-20 11:13:58 +08:00
typescript({
exclude: 'node_modules/**',
typescript: require('typescript')
}),
resolve({
preferBuiltins: false
}),
2020-04-07 20:18:43 +08:00
postcss({
plugins: [
url({ url: 'inline' })
]
}),
commonjs({
namedExports: {
eventemitter3: [ 'EventEmitter' ],
lodash: [ 'merge', 'clone' ]
2020-04-07 20:18:43 +08:00
}
}),
2020-03-20 11:13:58 +08:00
buble({
transforms: { generator: false }
2020-04-07 20:18:43 +08:00
}),
terser()
2020-03-20 11:13:58 +08:00
],
external: [
'@antv/l7'
],
2020-03-20 11:13:58 +08:00
output: [
{
format: 'umd',
2020-04-18 10:51:09 +08:00
name: 'L7.Draw',
file: pkg.unpkg,
2020-04-07 20:18:43 +08:00
sourcemap: true,
globals: {
'@antv/l7': 'L7'
}
2020-03-20 11:13:58 +08:00
}
]
};