-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathrollup.config.dev.js
33 lines (33 loc) · 1.07 KB
/
rollup.config.dev.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import json from 'rollup-plugin-json'
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import { eslint } from 'rollup-plugin-eslint'
import babel from 'rollup-plugin-babel' // 支持使用最新版本的 es 语法, 不包括语言新功能 polyfill,要使用 core-js
const plugins = [
json(),
eslint({
fix: true,
include: ['src/*']
}),
resolve({ preferBuiltins: true }), // so Rollup can find `ms`
commonjs(), // so Rollup can convert `ms` to an ES module
babel()
]
export default [
{
input: 'main.js',
output: [{
file: 'dist/esm/tqsdk.js',
name: 'TQSDK',
format: 'esm', // Keep the bundle as an ES module file, suitable for other bundlers and inclusion as a <script type=module> tag in modern browsers
globals: {
}
}, {
file: 'dist/umd/tqsdk-nocache.js',
name: 'TQSDK',
format: 'umd', // Keep the bundle as an ES module file, suitable for other bundlers and inclusion as a <script type=module> tag in modern browsers
globals: {
}
}],
plugins
}]