Skip to content

Commit

Permalink
update vite.config.js.
Browse files Browse the repository at this point in the history
vite 的 dev 与 build 的 default export module 输出不一致。
举例引入 quill-blot-formatter 包时,
dev 输出为 commonJs 格式,build 输出为 es module 格式。
此提交为vite github issue 解决方案。相关issue如下:
vitejs/vite#6112
vitejs/vite#9703


Signed-off-by: bawwtracs <kmi1prwiexrb41@gmail.com>
  • Loading branch information
bawwtracs authored and gitee-org committed Mar 22, 2023
1 parent 9d3986e commit c625b3e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ const {resolve} = require('path')
export default defineConfig(({mode, command}) => {
const env = loadEnv(mode, process.cwd())
return {
build: {
commonjsOptions: {
transformMixedEsModules: true,
include: [],
},
},
optimizeDeps: {
disabled: false,
},
server: {
port: 8080,
proxy: {
Expand Down

0 comments on commit c625b3e

Please sign in to comment.