| 12345678910111213141516171819202122232425262728 |
- // import resolve from 'rollup-plugin-node-resolve';
- // import commonjs from 'rollup-plugin-commonjs';
- import typescript from 'rollup-plugin-typescript2'; // 一定要是typescript2,如果使用typescript,没法自动生成.d.ts文件
- // import { terser } from 'rollup-plugin-terser';
- import pkg from './package.json';
- export default [
- // UMD for browser
- /* {
- input: 'src/index.ts',
- output: {
- name: 'howLongUntilLunch',
- file: pkg.browser,
- format: 'umd',
- },
- plugins: [resolve(), commonjs(), typescript(), terser()], // 浏览器使用的代码文件进行简化
- }, */
- // CommonJS for Node and ES module for bundlers build
- {
- input: 'src/index.ts',
- external: ['ms'],
- plugins: [typescript()],
- output: [
- { file: pkg.main, format: 'cjs' },
- // { file: pkg.module, format: 'es' },
- ],
- },
- ];
|