UNPKG

1.14 kBJavaScriptView Raw
1import { visualizer } from 'rollup-plugin-visualizer';
2const isBundleVis = !!process.env.BUNDLE_VIS;
3
4export default process.env.CI && process.env.CI === 'true'
5 ? {}
6 : {
7 umd: {
8 name: 'F2',
9 file: 'index',
10 minFile: true,
11 },
12 // entry: ['src/index.ts', 'src/jsx/jsx-runtime.ts'],
13 entry: ['src/index.ts'],
14 overridesByEntry: {
15 'src/index.ts': {
16 umd: { name: 'F2', file: 'index' },
17 },
18 // for weixin miniapp
19 // 'src/jsx/jsx-runtime.ts': {
20 // umd: { name: 'F2JSXRuntime', file: 'jsx-runtime' },
21 // },
22 },
23
24 typescriptOpts: {
25 tsconfigOverride: {
26 compilerOptions: {
27 target: 'es5',
28 },
29 },
30 },
31 extraBabelPlugins: [[
32 "search-and-replace",
33 {
34 "rules": [
35 {
36 "search": "VERSION",
37 "searchTemplateStrings": true,
38 "replace": JSON.stringify(require('./package').version)
39 }
40 ]
41 }
42 ]],
43 extraRollupPlugins: [...(isBundleVis ? [visualizer()] : [])],
44 };