Skip to content

Commit 26d420c

Browse files
committed
feat: support ie 11 (#809)
1 parent 00f2fc5 commit 26d420c

11 files changed

Lines changed: 1461 additions & 655 deletions

File tree

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const presets = [
55
useBuiltIns: 'usage',
66
corejs: { version: 3 },
77
targets: [
8+
'ie >= 11',
89
'> 1%',
910
'Firefox ESR',
1011
'last 4 versions',

build/index.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './banner.mjs'
2+
export * from './output.mjs'

build/output.mjs

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import terser from '@rollup/plugin-terser'
2+
import { banner } from './banner.mjs'
3+
4+
export const generateOutputs = (section = '') => {
5+
const path = section === ''? 'dist' : `dist/${section}`
6+
return [
7+
{
8+
name: 'WatermarkPlus',
9+
format: 'esm',
10+
file: `${path}/index.esm.js`,
11+
sourcemap: true,
12+
banner
13+
},
14+
{
15+
name: 'WatermarkPlus',
16+
format: 'umd',
17+
file: `${path}/index.umd.js`,
18+
sourcemap: true,
19+
banner
20+
},
21+
{
22+
name: 'WatermarkPlus',
23+
format: 'iife',
24+
file: `${path}/index.iife.js`,
25+
sourcemap: true,
26+
banner
27+
},
28+
{
29+
name: 'WatermarkPlus',
30+
format: 'cjs',
31+
file: `${path}/index.cjs.js`,
32+
sourcemap: true,
33+
banner
34+
},
35+
// min
36+
{
37+
name: 'WatermarkPlus',
38+
format: 'esm',
39+
file: `${path}/index.esm.min.js`,
40+
plugins: [terser()]
41+
},
42+
{
43+
name: 'WatermarkPlus',
44+
format: 'umd',
45+
file: `${path}/index.umd.min.js`,
46+
plugins: [terser()]
47+
},
48+
{
49+
name: 'WatermarkPlus',
50+
format: 'iife',
51+
file: `${path}/index.iife.min.js`,
52+
plugins: [terser()]
53+
},
54+
{
55+
name: 'WatermarkPlus',
56+
format: 'cjs',
57+
file: `${path}/index.cjs.min.js`,
58+
plugins: [terser()]
59+
}
60+
]
61+
}

0 commit comments

Comments
 (0)