Skip to content

Commit

Permalink
build(二维码): 构建失败修复
Browse files Browse the repository at this point in the history
  • Loading branch information
nihaojob committed Jun 7, 2024
1 parent 36f3207 commit 2d9eccc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/core/plugin/BarCodePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
* @Author: 秦少卫
* @Date: 2024-06-06 14:12:24
* @LastEditors: 秦少卫
* @LastEditTime: 2024-06-06 21:23:34
* @LastEditTime: 2024-06-07 11:44:54
* @Description: 条形码生成工具
*/

import { fabric } from 'fabric';
import Editor from '../Editor';
import JsBarcode from 'JsBarcode';
import 'JsBarcode';
type IEditor = Editor;

// 条形码生成参数
Expand All @@ -35,7 +35,7 @@ class BarCodePlugin {

_getBase64Str(option: any) {
const canvas = document.createElement('canvas');
JsBarcode(canvas, option.value, {
window.JsBarcode(canvas, option.value, {
...option,
});
const url = canvas.toDataURL('image/png', 1);
Expand Down
3 changes: 1 addition & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @Author: June
* @Date: 2023-04-24 00:25:39
* @LastEditors: 秦少卫
* @LastEditTime: 2024-06-07 11:35:26
* @LastEditTime: 2024-06-07 11:45:43
*/
import { defineConfig, loadEnv } from 'vite';
import vue from '@vitejs/plugin-vue';
Expand Down Expand Up @@ -56,7 +56,6 @@ const config = ({ mode }) => {
// sourcemap: !isProd,
emptyOutDir: true,
rollupOptions: {
external: ['JsBarcode'],
input: resolve(__dirname, 'index.html'),
output: {
chunkFileNames: 'js/[name].[hash].js',
Expand Down

0 comments on commit 2d9eccc

Please sign in to comment.