| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- import { defineConfig } from 'rollup';
- import { nodeResolve } from '@rollup/plugin-node-resolve';
- import commonjs from '@rollup/plugin-commonjs';
- import terser from '@rollup/plugin-terser';
- export default defineConfig({
- input: 'src/main.js',
- output: [
- {
- file: 'dist/bundle-iife.js',
- format: 'iife',
- name: 'MonitorSDK',
- globals: {
- // 定义全局变量映射
- }
- },
- {
- file: 'dist/bundle-esm.js',
- format: 'esm'
- },
- {
- file: 'dist/bundle-cjs.js',
- format: 'cjs'
- },
- {
- file: 'dist/bundle-umd.js',
- format: 'umd',
- name: 'MonitorSDK'
- }
- ],
- plugins: [
- nodeResolve({
- browser: true
- }),
- commonjs(),
- terser({
- format: {
- comments: false
- },
- compress: {
- drop_console: true, // 生产环境移除console
- drop_debugger: true
- }
- })
- ],
- external: [] // 外部依赖
- });
|