加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 1.55 KB
一键复制 编辑 原始数据 按行查看 历史
飘不起来也飘 提交于 2023-02-24 09:19 . 更新代码
import { fileURLToPath, URL } from 'node:url'
import { resolve } from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite';
// import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
import Markdown from 'vite-plugin-md'
import markdownItPrism from 'markdown-it-prism'
// https://vitejs.dev/config/
export default defineConfig({
base: './',
publicDir: '/libPublic',
plugins: [
vue({
include: [/\.vue$/, /\.md$/], // <--
}),
Markdown({
markdownItOptions: {
html: true,
linkify: true,
typographer: true,
},
markdownItSetup(md) {
// add code syntax highlighting with Prism
md.use(require(markdownItPrism))
},
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"]
},
css: {
preprocessorOptions: {
less: { javascriptEnabled: true, }
},
},
server: {
port: 8082,
host: '0.0.0.0',
proxy: {}
},
build: {
outDir: './public/RunLibs/SimpleMap/',
sourcemap: false,
rollupOptions: {
external: ['vue', 'cesium', 'ant-design-vue', '@ant-design'],
output: {
globals: {
vue: 'Vue',
cesium: 'Cesium'
}
}
},
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'SimpleMap',
formats: ['es', 'umd'],
fileName: (format) => `SimpleMap.${format}.js`
},
},
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化