UNPKG

ucc-sdk

Version:
40 lines (37 loc) 1.12 kB
import rollupNodeResolve from '@rollup/plugin-node-resolve'; import rollupJson from '@rollup/plugin-json'; import commonjs from '@rollup/plugin-commonjs'; export default [ // browser-friendly UMD build { input: 'src/main.js', output: { name: 'uccSdk', file: 'dist/bundle.umd.js', format: 'umd', }, plugins: [ rollupNodeResolve({ jsnext: true, preferBuiltins: true, browser: true }), // so Rollup can find `axios` rollupJson(), commonjs(), // so Rollup can convert `axios` to an ES module ] }, // CommonJS (for Node) and ES module (for bundlers) build. // (We could have three entries in the configuration array // instead of two, but it's quicker to generate multiple // builds from a single configuration where possible, using // an array for the `output` option, where we can specify // `file` and `format` for each target) { input: 'src/main.js', external: ['axios', 'uuid', 'get-browser-fingerprint'], output: [ { file: 'dist/bundle.cjs.js', format: 'cjs' }, { file: 'dist/bundle.esm.js', format: 'es' } ] } ];