🔧(script): 打包 build 去 注释 console.log debugger

This commit is contained in:
就眠儀式 2022-06-25 22:45:44 +08:00
parent 23bff375cf
commit 77be989540
10 changed files with 55 additions and 5 deletions

View File

@ -24,6 +24,16 @@ export default (): UserConfigExport => {
formats: ["es"], formats: ["es"],
fileName: (name) => `index.js`, fileName: (name) => `index.js`,
}, },
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log']
},
output: {
comments: true
}
},
rollupOptions: { rollupOptions: {
output: { output: {
globals: { globals: {

View File

@ -66,6 +66,16 @@ export default (): UserConfigExport => {
entry: resolve(process.cwd(), "./src/index.ts"), entry: resolve(process.cwd(), "./src/index.ts"),
formats: ["es"], formats: ["es"],
}, },
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log']
},
output: {
comments: true
}
},
rollupOptions: { rollupOptions: {
input: inputs, input: inputs,
output: { output: {

View File

@ -24,6 +24,16 @@ export default (): UserConfigExport => {
formats: ["umd"], formats: ["umd"],
fileName: (name) => `index.js`, fileName: (name) => `index.js`,
}, },
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log']
},
output: {
comments: true
}
},
rollupOptions: { rollupOptions: {
output: { output: {
globals: { globals: {

View File

@ -15,8 +15,8 @@
<link rel="icon" href="/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
<title>layer-vue 弹层解决方案</title> <title>layer-vue 弹层解决方案</title>
<!--preload-links--> <!--preload-links-->
<script type="module" crossorigin src="/assets/index.1157d8c1.js"></script> <script type="module" crossorigin src="/assets/index.0df87e64.js"></script>
<link rel="stylesheet" href="/assets/index.e9614e1e.css"> <link rel="stylesheet" href="/assets/index.3f855dd4.css">
</head> </head>
<body> <body>

View File

@ -20,6 +20,16 @@ export default defineConfig({
entry: path.resolve(__dirname, "src/index.ts"), entry: path.resolve(__dirname, "src/index.ts"),
name: camelize(name), name: camelize(name),
}, },
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log']
},
output: {
comments: true
}
},
rollupOptions: { rollupOptions: {
output: { output: {
exports: "named", exports: "named",

View File

@ -21,6 +21,16 @@ export default defineConfig({
entry: path.resolve(__dirname, "src/index.ts"), entry: path.resolve(__dirname, "src/index.ts"),
name: camelize(name), name: camelize(name),
}, },
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log']
},
output: {
comments: true
}
},
rollupOptions: { rollupOptions: {
output: { output: {
exports: "named", exports: "named",