UNPKG

811 BJavaScriptView Raw
1import string from 'rollup-plugin-string'
2import json from 'rollup-plugin-json'
3import commonjs from 'rollup-plugin-commonjs'
4import uglify from 'rollup-plugin-uglify'
5import { minify } from 'uglify-es'
6import { dependencies } from '../package.json'
7
8const external = [...Object.keys(dependencies), 'fs', 'path']
9export default {
10 input: 'src/bin/index.js',
11 output: {
12 file: 'dist/weact-cli',
13 format: 'cjs',
14 banner: '#!/usr/bin/env node',
15 },
16 plugins: [
17 json(),
18 string({ include: '**/*.md' }),
19 commonjs({
20 sourceMap: false,
21 namedExports: {
22 'src/bin/transform.js': ['transform'],
23 },
24 ignore: [
25 '@babel/traverse',
26 '@babel/generator',
27 ]
28 }),
29 process.env.BUILD === 'production' ? uglify({}, minify) : false,
30 ],
31 external,
32}