Skip to content

Commit 991de59

Browse files
committed
chore: generate umd in docs
1 parent 54bc5d9 commit 991de59

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/quill-table-up@latest/dist/table-creator.css" />
2626
<script src="https://cdn.jsdelivr.net/gh/quill-modules/quill-easy-color@gh-pages/index.umd.js"></script>
2727
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/quill-modules/quill-easy-color@gh-pages/index.css" />
28-
<script src="./dev.js"></script>
28+
<script src="./index.umd.js"></script>
2929
<link rel="stylesheet" href="./index.css" />
3030
<style>
3131
.main {

gulpfile.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,20 @@ const buildDts = async () => {
3333
});
3434
};
3535
const buildTs = async (isDev: boolean = false) => {
36-
const plugins = [typescript({ tsconfig: './tsconfig.json' }), nodeResolve(), terser()];
36+
const plugins = [
37+
typescript({ tsconfig: './tsconfig.json' }),
38+
nodeResolve(),
39+
];
40+
!isDev && plugins.push(terser());
3741
const bundle = await rollup({
3842
input: './src/index.ts',
3943
external: ['quill'],
4044
treeshake: true,
4145
plugins,
4246
});
43-
if (isDev) {
47+
if (!isDev) {
4448
await bundle.write({
45-
file: resolve(demoBundle, 'dev.js'),
49+
file: resolve(distBundle, 'index.umd.js'),
4650
sourcemap: true,
4751
format: 'umd',
4852
name: 'QuillShortcutKey',
@@ -54,7 +58,7 @@ const buildTs = async (isDev: boolean = false) => {
5458
}
5559

5660
await bundle.write({
57-
file: resolve(distBundle, 'index.umd.js'),
61+
file: resolve(demoBundle, 'index.umd.js'),
5862
sourcemap: true,
5963
format: 'umd',
6064
name: 'QuillShortcutKey',

0 commit comments

Comments
 (0)