|
1 |
| -import resolve from 'rollup-plugin-node-resolve'; |
2 |
| -import commonjs from 'rollup-plugin-commonjs'; |
3 |
| -import babel from 'rollup-plugin-babel'; |
4 |
| -import json from 'rollup-plugin-json'; |
5 |
| -import compiler from '@ampproject/rollup-plugin-closure-compiler'; |
6 |
| -import bundleSize from 'rollup-plugin-bundle-size'; |
7 |
| -import pkg from './package.json'; |
| 1 | +import resolve from "rollup-plugin-node-resolve"; |
| 2 | +import commonjs from "rollup-plugin-commonjs"; |
| 3 | +import babel from "rollup-plugin-babel"; |
| 4 | +import json from "rollup-plugin-json"; |
| 5 | +import compiler from "@ampproject/rollup-plugin-closure-compiler"; |
| 6 | +import bundleSize from "rollup-plugin-bundle-size"; |
| 7 | +import pkg from "./package.json"; |
8 | 8 |
|
9 | 9 | const sourcemapOption = process.env.PROD ? undefined : "inline";
|
10 | 10 |
|
11 | 11 | const babelPluginConfig = {
|
12 | 12 | // so Rollup can convert unsupported es6 code to es5
|
13 |
| - exclude: ['node_modules/**'], |
| 13 | + exclude: ["node_modules/**"], |
14 | 14 | plugins: [
|
15 |
| - ['@babel/plugin-proposal-class-properties'], |
16 |
| - ['@babel/plugin-proposal-object-rest-spread'], |
| 15 | + ["@babel/plugin-proposal-class-properties"], |
| 16 | + ["@babel/plugin-proposal-object-rest-spread"] |
17 | 17 | ]
|
18 | 18 | };
|
19 | 19 |
|
20 |
| -let plugins = [ |
21 |
| - resolve(), |
22 |
| - commonjs(), |
23 |
| - json(), |
24 |
| - babel(babelPluginConfig) |
25 |
| -] |
| 20 | +let plugins = [resolve(), commonjs(), json(), babel(babelPluginConfig)]; |
26 | 21 |
|
27 | 22 | if (process.env.PROD) {
|
28 |
| - plugins = [ |
29 |
| - ...plugins, |
30 |
| - compiler(), |
31 |
| - bundleSize() |
32 |
| - ] |
| 23 | + plugins = [...plugins, compiler(), bundleSize()]; |
33 | 24 | }
|
34 | 25 |
|
35 |
| - |
36 | 26 | const libBundles = [
|
37 | 27 | {
|
38 | 28 | input: "lib/lib.js",
|
@@ -64,7 +54,7 @@ const libBundles = [
|
64 | 54 | file: pkg.browser,
|
65 | 55 | format: "iife",
|
66 | 56 | sourcemap: sourcemapOption,
|
67 |
| - name: "asbuild" |
| 57 | + name: "AsBindIIFE" |
68 | 58 | },
|
69 | 59 | watch: {
|
70 | 60 | clearScreen: false
|
|
0 commit comments