1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- import nodeResolve from '@rollup/plugin-node-resolve'
- import commonjs from "@rollup/plugin-commonjs"
- import babel from '@rollup/plugin-babel'
- import { uglify } from 'rollup-plugin-uglify'
- import json from '@rollup/plugin-json';
- export default {
- input: "./src/index.js",
- // input: "./math.js",
- output: [
- {
- format: "es",
- name: 'ComPDFKitViewer',
- file: "../webview/lib/webview.min.js",
- sourcemap: false
- }
- ],
- plugins: [
- json(),
- nodeResolve({
- preferBuiltins: true,
- mainFields: ['browser']
- }),
- commonjs(),
- // (uglify()),
- // (process.env === 'production' && uglify()),
- babel({
- exclude: 'node_modules/**', // 防止打包node_modules下的文件
- // 使用预设
- presets: [['@babel/preset-env', {
- "modules": false,
- // 目标浏览器
- "targets": {
- "edge": '17',
- "firefox": '60',
- "chrome": '67',
- "safari": '10.0',
- 'ie': '10',
- },
- }]]
- })
- ],
- sourcemap: false
- };
|