Files
kintone-vue-template/vite.mobile.config.ts
2025-10-17 14:34:26 +08:00

27 lines
780 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import * as path from 'path';
/**
* 将移动端 mobile.ts 文件打包为立即执行函数表达式 (IIFE) 格式
*/
export default {
build: {
lib: {
entry: path.resolve(__dirname, 'src/js/mobile.ts'),
name: 'MobilePlugin',
formats: ['iife'],
fileName: () => 'mobile.js', // 输出文件名,和 manifest.json 中的 name 一致
},
rollupOptions: {
external: ['kintone'], // kintone 是网站提供的 api需要处理
output: {
globals: {
kintone: 'kintone',
},
},
},
sourcemap: false,
emptyOutDir: false, // 不清空输出目录,随后拷贝到 dist 目录中之后自动删除
outDir: path.resolve(__dirname, 'dist-iife/mobile'), // 输出到 dist-iife 目录
},
};