|
1 | | -import resolve from 'rollup-plugin-node-resolve' |
2 | | -import commonjs from 'rollup-plugin-commonjs' |
3 | | -import sourceMaps from 'rollup-plugin-sourcemaps' |
4 | | -import camelCase from 'lodash.camelcase' |
5 | | -import typescript from 'rollup-plugin-typescript2' |
| 1 | +import resolve from "rollup-plugin-node-resolve" |
| 2 | +import commonjs from "rollup-plugin-commonjs" |
| 3 | +import sourceMaps from "rollup-plugin-sourcemaps" |
| 4 | +import camelCase from "lodash.camelcase" |
| 5 | +import typescript from "rollup-plugin-typescript2" |
6 | 6 |
|
7 | | -const pkg = require('./package.json') |
| 7 | +const pkg = require("./package.json") |
8 | 8 |
|
9 | | -const libraryName = 'mosia' |
| 9 | +const libraryName = "mosia" |
10 | 10 |
|
11 | | -export default { |
12 | | - input: `src/${libraryName}.ts`, |
13 | | - output: [ |
14 | | - { file: pkg.main, name: camelCase(libraryName), format: 'umd' }, |
15 | | - { file: pkg.module, format: 'es' }, |
16 | | - ], |
17 | | - sourcemap: true, |
18 | | - // Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash') |
19 | | - external: [], |
20 | | - watch: { |
21 | | - include: 'src/**', |
| 11 | +export default [ |
| 12 | + { |
| 13 | + input: `src/cli.js`, |
| 14 | + output: { file: "dist/cli.umd.js", format: "umd" }, |
22 | 15 | }, |
23 | | - plugins: [ |
24 | | - // Compile TypeScript files |
25 | | - typescript(), |
26 | | - // Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs) |
27 | | - commonjs(), |
28 | | - // Allow node_modules resolution, so you can use 'external' to control |
29 | | - // which external modules to include in the bundle |
30 | | - // https://github.com/rollup/rollup-plugin-node-resolve#usage |
31 | | - resolve(), |
| 16 | + { |
| 17 | + input: `src/${libraryName}.ts`, |
| 18 | + output: [ |
| 19 | + { file: pkg.main, name: camelCase(libraryName), format: "umd" }, |
| 20 | + { file: pkg.module, format: "es" } |
| 21 | + ], |
| 22 | + sourcemap: true, |
| 23 | + // Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash') |
| 24 | + external: [], |
| 25 | + watch: { |
| 26 | + include: "src/**" |
| 27 | + }, |
| 28 | + plugins: [ |
| 29 | + // Compile TypeScript files |
| 30 | + typescript(), |
| 31 | + // Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs) |
| 32 | + commonjs(), |
| 33 | + // Allow node_modules resolution, so you can use 'external' to control |
| 34 | + // which external modules to include in the bundle |
| 35 | + // https://github.com/rollup/rollup-plugin-node-resolve#usage |
| 36 | + resolve(), |
32 | 37 |
|
33 | | - // Resolve source maps to the original source |
34 | | - sourceMaps(), |
35 | | - ], |
36 | | -} |
| 38 | + // Resolve source maps to the original source |
| 39 | + sourceMaps() |
| 40 | + ] |
| 41 | + } |
| 42 | +] |
0 commit comments