浏览代码

fix: fix require error

vben 4 年之前
父节点
当前提交
06e1d3879b
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      build/vite/plugin/index.ts

+ 2 - 2
build/vite/plugin/index.ts

@@ -11,8 +11,8 @@ import gzipPlugin from './gzip/index';
 
 import { hmScript } from '../hm';
 
-const pkg = require('../../../package.json');
-
+// @ts-ignore
+import pkg from '../../../package.json';
 import { isDevFn, isProdFn, isSiteMode, ViteEnv, isReportMode, isBuildGzip } from '../../utils';
 import { GLOB_CONFIG_FILE_NAME } from '../../constant';