forked from scrapooo/quill-resize-module
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathrollup.config.js
More file actions
110 lines (109 loc) · 2.6 KB
/
Copy pathrollup.config.js
File metadata and controls
110 lines (109 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
const { nodeResolve } = require("@rollup/plugin-node-resolve");
const commonjs = require("@rollup/plugin-commonjs");
const typescript = require("@rollup/plugin-typescript");
const terser = require("@rollup/plugin-terser");
const postcss = require("rollup-plugin-postcss");
module.exports = [
{
input: "src/main.ts",
output: {
name: "QuillResizeModule",
file: "dist/quill-resize-module.js",
format: "umd",
sourcemap: true
},
plugins: [
nodeResolve({
preferBuiltins: false,
browser: true
}),
commonjs(),
typescript({
tsconfig: "./tsconfig.rollup.json",
declaration: false,
sourceMap: true
}),
postcss({
inject: true,
minimize: false
})
]
},
{
// Real ES module build (native `export`/`import` syntax), so Node's
// ESM loader and modern bundlers (Vite, Webpack 5, Rollup) can resolve
// this package's "import" condition to actual ESM instead of a UMD
// bundle wrapped in a CommonJS/AMD/global detector. The ".mjs"
// extension makes Node treat it as ESM unambiguously, regardless of
// this package's (CommonJS-default) "type" field.
input: "src/main.ts",
output: {
file: "dist/quill-resize-module.esm.mjs",
format: "es",
sourcemap: true
},
plugins: [
nodeResolve({
preferBuiltins: false,
browser: true
}),
commonjs(),
typescript({
tsconfig: "./tsconfig.rollup.json",
declaration: false,
sourceMap: true
}),
postcss({
inject: true,
minimize: false
})
]
},
{
input: "src/main.ts",
output: {
name: "QuillResizeModule",
file: "dist/quill-resize-module.min.js",
format: "umd",
sourcemap: false
},
plugins: [
nodeResolve({
preferBuiltins: false,
browser: true
}),
commonjs(),
typescript({
tsconfig: "./tsconfig.rollup.json",
declaration: false,
sourceMap: false
}),
terser({
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log'],
passes: 2
},
mangle: {
properties: {
regex: /^_/
}
},
format: {
comments: false
}
}),
postcss({
inject: true,
minimize: {
preset: ['default', {
discardComments: { removeAll: true },
normalizeWhitespace: true,
minifySelectors: true
}]
}
})
]
}
];