版博士V2.0程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

48 lines
1.2 KiB

  1. import resolve from '@rollup/plugin-node-resolve';
  2. import commonjs from '@rollup/plugin-commonjs';
  3. import json from '@rollup/plugin-json';
  4. import nodePolyfills from 'rollup-plugin-polyfill-node';
  5. import { terser } from 'rollup-plugin-terser';
  6. import pkg from './package.json';
  7. const commonPlugins = [
  8. json(),
  9. commonjs(),
  10. resolve({ preferBuiltins: false, browser: true }),
  11. nodePolyfills(),
  12. ];
  13. export default [
  14. // browser-friendly UMD build
  15. {
  16. input: 'index.js',
  17. output: {
  18. name: 'gogocode',
  19. file: pkg.browser,
  20. format: 'umd',
  21. },
  22. onwarn: function (warning) {
  23. if (warning.code === 'THIS_IS_UNDEFINED') {
  24. return;
  25. }
  26. console.error(warning.message);
  27. },
  28. plugins: commonPlugins,
  29. },
  30. {
  31. input: 'index.js',
  32. output: {
  33. name: 'gogocode',
  34. file: 'umd/gogocode.min.js',
  35. format: 'umd',
  36. },
  37. onwarn: function (warning) {
  38. if (warning.code === 'THIS_IS_UNDEFINED') {
  39. return;
  40. }
  41. console.error(warning.message);
  42. },
  43. plugins: [...commonPlugins, terser()],
  44. },
  45. ];