Skip to content

Commit 2743a0b

Browse files
committed
improved build pipeline
1 parent 0ca1674 commit 2743a0b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@
2222
"@storybook/react-vite": "^8.0.5",
2323
"@storybook/test": "^8.0.5",
2424
"prop-types": "^15.8.1",
25-
"rollup-plugin-copy": "^3.5.0",
25+
"rollup-plugin-terser": "^7.0.2",
2626
"storybook": "^8.0.5",
2727
"vite": "^5.2.7"
2828
},
2929
"dependencies": {
30+
"@rollup/plugin-terser": "^0.4.4",
3031
"@tinymce/tinymce-react": "^5.0.1",
3132
"markdown-it": "^14.1.0",
3233
"tinymce": "^7.0.0",

vite.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { defineConfig } from 'vite'
22
import { resolve } from 'path'
3+
import terser from '@rollup/plugin-terser';
34

45
const outputDir = 'supercode';
56

@@ -21,11 +22,23 @@ const SupercodeHotReload = () => {
2122

2223
export default defineConfig({
2324
build: {
25+
minify: 'terser',
2426
lib: {
2527
entry: resolve(__dirname, 'src/plugin.js'),
2628
formats: ['es'],
2729
fileName: 'plugin.min',
2830
},
31+
rollupOptions: {
32+
plugins: [terser({
33+
format: {
34+
comments: false,
35+
},
36+
mangle: {
37+
keep_classnames: false,
38+
reserved: [],
39+
},
40+
})],
41+
},
2942
copyPublicDir: false,
3043
outDir: outputDir,
3144
emptyOutDir: false,

0 commit comments

Comments
 (0)