dsy 3 månader sedan
förälder
incheckning
fd62100485

+ 1 - 1
.env

@@ -11,4 +11,4 @@ VUE_APP_BookWebSI = '/GCLSBookWebSI/ServiceInterface'
 VUE_APP_EepServer = '/EEPServer/SI'
 
 #version
-VUE_APP_VERSION = '2026.06.16'
+VUE_APP_VERSION = '2026.06.24'

+ 2 - 0
.gitignore

@@ -2,6 +2,8 @@
 node_modules
 /dist
 /out
+packages/eep
+eep-ui-*.tgz
 
 # local env files
 .env.local

+ 4 - 0
babel.config.js

@@ -5,5 +5,9 @@ module.exports = {
       // 解决 Vue 热加载编译速度慢问题
       plugins: ['dynamic-import-node'],
     },
+    production: {
+      // 发布库到其它项目时,避免保留 ?. / ?? 导致旧构建器解析失败
+      plugins: ['@babel/plugin-transform-optional-chaining', '@babel/plugin-transform-nullish-coalescing-operator'],
+    },
   },
 };

+ 1 - 1
jsconfig.json

@@ -9,7 +9,7 @@
     },
     "lib": ["esnext", "dom", "dom.iterable", "scripthost"]
   },
-  "exclude": ["node_modules", "dist"],
+  "exclude": ["node_modules", "dist", "packages/eep"],
   "vueCompilerOptions": {
     "target": 2
   }

+ 1 - 1
main.js

@@ -33,7 +33,7 @@ const createWindow = () => {
       pathname: path.join(__dirname, './dist', 'index.html'),
       protocol: 'file:',
       slashes: true, // true: file://, false: file:
-      hash: '/login', // /image_change 图片切换页
+      hash: '/login', // 设置默认路由为 /login
     }),
   );
 

+ 11 - 8
package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "eep_page",
-  "version": "2026.03.21",
+  "version": "2026.04.16",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "eep_page",
-      "version": "2026.03.21",
+      "version": "2026.04.16",
       "hasInstallScript": true,
       "dependencies": {
         "@tinymce/tinymce-vue": "^3.2.8",
@@ -15,9 +15,9 @@
         "cnchar": "^3.2.6",
         "core-js": "^3.47.0",
         "dompurify": "^3.1.5",
+        "eep-ui": "file:eep-ui-0.0.3.tgz",
         "element-ui": "^2.15.14",
         "hanzi-writer": "^3.7.0",
-        "jquery": "^3.7.1",
         "js-audio-recorder": "^1.0.7",
         "mathjax": "^3.2.2",
         "md5": "^2.3.0",
@@ -8084,6 +8084,14 @@
       "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
       "dev": true
     },
+    "node_modules/eep-ui": {
+      "version": "0.0.3",
+      "resolved": "file:eep-ui-0.0.3.tgz",
+      "integrity": "sha512-3v5Scb34QDh24gh2QI572y6g3zpzBJ+2OWvXGXC5I1BfJqRpdyoNPirFA5jOx8qnSLQwfV5CFWMa6l21Lvh70w==",
+      "peerDependencies": {
+        "vue": "^2.6.14"
+      }
+    },
     "node_modules/ejs": {
       "version": "3.1.10",
       "resolved": "https://registry.npmmirror.com/ejs/-/ejs-3.1.10.tgz",
@@ -11861,11 +11869,6 @@
         "@sideway/pinpoint": "^2.0.0"
       }
     },
-    "node_modules/jquery": {
-      "version": "3.7.1",
-      "resolved": "https://registry.npmmirror.com/jquery/-/jquery-3.7.1.tgz",
-      "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg=="
-    },
     "node_modules/js-audio-recorder": {
       "version": "1.0.7",
       "resolved": "https://registry.npmmirror.com/js-audio-recorder/-/js-audio-recorder-1.0.7.tgz",

+ 4 - 2
package.json

@@ -10,6 +10,8 @@
     "dev": "vue-cli-service serve",
     "build": "vue-cli-service build",
     "build:beiyu": "vue-cli-service build --mode beiyu",
+    "lib:pkg": "vue-cli-service build --target lib --dest packages/eep --name eep-ui packages/index.js",
+    "pack:pkg": "npm --prefix packages run pack",
     "lint": "vue-cli-service lint",
     "lint:style:fix": "stylelint \"src/**/*.{css,scss,vue}\" --fix",
     "lint:fix": "eslint \"src/**/*.{js,vue}\" --fix",
@@ -21,15 +23,15 @@
     "builder:mac": "electron-builder --mac"
   },
   "dependencies": {
-    "7zip-bin": "^5.2.0",
     "@tinymce/tinymce-vue": "^3.2.8",
+    "7zip-bin": "^5.2.0",
     "axios": "^1.7.2",
     "cnchar": "^3.2.6",
     "core-js": "^3.47.0",
     "dompurify": "^3.1.5",
+    "eep-ui": "file:eep-ui-0.0.3.tgz",
     "element-ui": "^2.15.14",
     "hanzi-writer": "^3.7.0",
-    "jquery": "^3.7.1",
     "js-audio-recorder": "^1.0.7",
     "mathjax": "^3.2.2",
     "md5": "^2.3.0",

+ 538 - 0
packages/BookEep.vue

@@ -0,0 +1,538 @@
+<template>
+  <div class="common-preview">
+    <div class="audit-content" >
+      <div ref="previewMain" class="main-container" :style="{ paddingLeft: '0', paddingRight: '0' }">
+        <main :class="['preview-main', 'no-audit']" :style="computedCommonPreviewStyle">
+          <div class="preview-left" :style="{ backgroundColor: background.background?.is_global ? '' : '#fff' }"></div>
+          <CoursewarePreview
+            ref="courseware"
+            :is-show-group="false"
+            :group-show-all="true"
+            :group-row-list="contentGroupRowList"
+            :data="data"
+            :courseware-id="curSelectId"
+            :component-list="componentList"
+            :background="background"
+            :can-remark="false"
+            :show-remark="false"
+            :component-remark-obj="{}"
+            :project="project"
+          />
+          <div class="preview-right" :style="{ backgroundColor: background.background?.is_global ? '' : '#fff' }"></div>
+        </main>
+      </div>
+      <div v-if="!sidebarShow" class="back-top" @click="backTop">
+        <img :src="require(`@/assets/icon/back-top.png`)" alt="返回顶部" />
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import CoursewarePreview from '@/views/book/courseware/preview/CoursewarePreview.vue';
+
+import { isTrue } from '@/utils/validate';
+import { buildCoursewareStyle } from '@/views/book/courseware/preview/common/utils/coursewareStyle';
+
+export default {
+  name: 'CommonPreview',
+  components: {
+    CoursewarePreview,
+  },
+  provide() {
+    return {
+      getLang: () => this.lang,
+      getChinese: () => this.chinese,
+      getShowPinYin: () => this.showPinYin,
+      getLangList: () => this.langList,
+      convertText: this.convertText,
+      getTitleList: () => this.title_list,
+      getPermissionControl: () => this.permissionControl,
+    };
+  },
+  props: {
+    id: {
+      type: String,
+      default: '',
+    },
+    // 内容分组行列表
+    contentGroupRowList: {
+      type: Array,
+      default: () => [],
+    },
+    // 组件列表
+    componentList: {
+      type: Array,
+      default: () => [],
+    },
+    // 教材背景
+    background: {
+      type: Object,
+      default: () => ({}),
+    },
+  },
+  data() {
+    return {
+      data: { row_list: [] },
+      curSelectId: this.id,
+      isTrue,
+      sidebarShow: true,
+      project: {
+        editor: '', // 作者
+        cover_image_file_id: null, // 封面图片ID
+        cover_image_file_url: '', // 封面图片URL
+      },
+      title_list: [],
+      node_list: [],
+      permissionControl: {
+        can_answer: true, // 可作答
+        can_judge_correct: false, // 可判断对错(客观题)
+        can_show_answer: false, // 可查看答案
+        can_correct: false, // 可批改
+        can_check_correct: false, // 可查看批改
+      },
+      popoverShow: false,
+      is_can_edit: 'false', // 是否可以编辑
+    };
+  },
+  computed: {
+    computedCommonPreviewStyle() {
+      return buildCoursewareStyle(this.background, 'commonPreview');
+    },
+  },
+  methods: {
+    backTop() {
+      this.$refs.previewMain.scrollTo({
+        top: 0,
+        left: 0,
+        behavior: 'smooth',
+      });
+    },
+
+    convertText(text) {
+      return text;
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+@use '@/styles/mixin.scss' as *;
+
+$total-width: $courseware-width + $courseware-left-margin + $courseware-right-margin;
+
+.common-preview {
+  .main-container {
+    position: relative;
+    flex: 1;
+    min-width: 1110px;
+    padding: 15px 0;
+    overflow: auto;
+    background-color: #ececec;
+
+    .catalogue-bar {
+      position: absolute;
+      top: 15px;
+      left: 0;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      width: 54px;
+      height: 54px;
+      margin: -9px 6px 0 240px;
+      cursor: pointer;
+      background-color: #fff;
+      border-radius: 2px;
+      box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 40%);
+    }
+
+    .sidebar-bar {
+      position: absolute;
+      top: 0;
+      right: 240px;
+      display: flex;
+      width: 60px;
+      height: calc(100vh - 166px);
+
+      .toolbar {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        width: 60px;
+        height: 100%;
+
+        img {
+          cursor: pointer;
+        }
+
+        &-special {
+          display: flex;
+          flex-direction: column;
+          row-gap: 16px;
+          align-items: center;
+          width: 100%;
+          margin-bottom: 24px;
+          background-color: #fff;
+
+          img {
+            width: 36px;
+            height: 36px;
+          }
+        }
+      }
+    }
+  }
+
+  .back-top {
+    position: absolute;
+    right: 240px;
+    bottom: 0;
+    display: flex;
+    place-content: center center;
+    align-items: center;
+    width: 60px;
+    height: 60px;
+    cursor: pointer;
+    background-color: #fff;
+  }
+
+  main.preview-main {
+    display: flex;
+    flex: 1;
+    width: calc($total-width);
+    min-width: calc($total-width);
+    max-width: calc($total-width);
+    min-height: 100%;
+    margin: 0 auto;
+    background-color: #fff;
+    border-radius: 4px;
+    box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 40%);
+
+    .preview-left {
+      width: $courseware-left-margin;
+      min-width: $courseware-left-margin;
+      max-width: $courseware-left-margin;
+      background-color: $courseware-bgColor;
+    }
+
+    .preview-right {
+      width: $courseware-right-margin;
+      min-width: $courseware-right-margin;
+      max-width: $courseware-right-margin;
+      background-color: $courseware-bgColor;
+    }
+
+    &.no-audit {
+      margin: 0 auto;
+    }
+  }
+
+  .audit-content {
+    display: flex;
+    min-width: 1810px;
+    height: calc(100vh - 166px);
+
+    &_org {
+      height: calc(100vh - 126px);
+    }
+
+    .left-menu {
+      display: flex;
+      flex-direction: column;
+      width: $catalogue-width;
+      font-family: 'Microsoft YaHei', 'Arial', sans-serif;
+      background-color: #fff;
+
+      .courseware-info {
+        display: flex;
+        column-gap: 18px;
+        width: 100%;
+        height: 186px;
+        padding: 6px 6px 24px;
+        border-bottom: $border;
+
+        .cover-image {
+          display: flex;
+          align-items: center;
+          justify-content: center;
+          width: 111px;
+          height: 157px;
+          background-color: rgba(229, 229, 229, 100%);
+
+          img {
+            max-width: 111px;
+            max-height: 157px;
+          }
+        }
+
+        .info-content {
+          display: flex;
+          flex-direction: column;
+          justify-content: space-between;
+
+          .catalogue-icon {
+            text-align: right;
+
+            .svg-icon {
+              cursor: pointer;
+            }
+          }
+
+          .courseware {
+            width: 159px;
+            height: 64px;
+            font-size: 16px;
+
+            .name {
+              font-weight: bold;
+            }
+
+            .editor {
+              display: -webkit-box;
+              overflow: hidden;
+              text-overflow: ellipsis;
+              word-break: break-word;
+              white-space: normal;
+              -webkit-line-clamp: 2; /* 多行省略行数,按需调整 */
+              -webkit-box-orient: vertical;
+            }
+          }
+        }
+      }
+    }
+
+    .sidebar {
+      position: relative;
+      display: flex;
+      width: $sidebar-width;
+
+      .toolbar {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        width: 60px;
+        height: 100%;
+        background-color: rgba(247, 248, 250, 100%);
+
+        img {
+          cursor: pointer;
+        }
+
+        &-special {
+          display: flex;
+          flex-direction: column;
+          row-gap: 16px;
+          margin-bottom: 24px;
+        }
+
+        &-list {
+          display: flex;
+          flex-direction: column;
+          row-gap: 16px;
+          align-items: center;
+          width: 100%;
+
+          .sidebar-item {
+            width: 100%;
+            text-align: center;
+
+            .sidebar-icon {
+              width: 36px;
+              height: 36px;
+              cursor: pointer;
+            }
+
+            &.active {
+              background-color: #4095e5;
+            }
+          }
+        }
+      }
+
+      .content {
+        flex: 1;
+        background-color: #fff;
+
+        .resource_box {
+          height: 100%;
+          overflow-y: auto;
+          border: 1px solid #e5e5e5;
+
+          h5 {
+            position: fixed;
+            z-index: 999;
+            width: 240px;
+            padding: 0 5px;
+            margin: 0;
+            font-size: 18px;
+            line-height: 40px;
+            background: #f2f3f5;
+          }
+
+          .scroll-container {
+            display: flex;
+            flex-direction: column;
+            row-gap: 8px;
+            margin: 6px;
+
+            .list-item {
+              display: flex;
+              align-items: center;
+              cursor: pointer;
+              border: 1px solid #ccc;
+              border-radius: 8px;
+
+              :deep .el-slider {
+                .el-slider__runway {
+                  background-color: #eee;
+                }
+              }
+
+              .el-image {
+                display: flex;
+                width: 100%;
+                min-width: 100%;
+                height: 90px;
+                background-color: #ccc;
+                border-radius: 8px;
+              }
+
+              .video-play {
+                width: 100%;
+                min-width: 100%;
+              }
+
+              .text-box {
+                word-break: break-word;
+              }
+            }
+          }
+
+          p {
+            color: #999;
+            text-align: center;
+          }
+
+          .card-box li {
+            padding: 10px;
+            border-bottom: 1px solid #ccc;
+
+            .el-icon-notebook-2 {
+              display: block;
+              margin-bottom: 4px;
+              font-size: 12px;
+              color: grey;
+            }
+          }
+        }
+      }
+
+      .back-top {
+        position: absolute;
+        bottom: 0;
+        left: 0;
+        display: flex;
+        place-content: center center;
+        align-items: center;
+        width: 60px;
+        height: 60px;
+        cursor: pointer;
+      }
+    }
+  }
+}
+
+:deep .scroll-container .audio-wrapper {
+  width: 100% !important;
+
+  .audio-middle {
+    width: 100% !important;
+    padding: 6px 8px !important;
+    border: none;
+    border-radius: 8px;
+
+    .audio-name {
+      text-align: left;
+    }
+
+    .slider-area {
+      column-gap: 8px !important;
+    }
+
+    :deep .remark-dialog {
+      .el-dialog__body {
+        padding: 5px 20px;
+      }
+    }
+
+    :deep .audit-dialog {
+      .el-dialog__body {
+        height: calc(100vh - 260px);
+        padding: 5px 20px;
+      }
+
+      .mind-map-container .mind-map {
+        height: calc(100vh - 310px);
+      }
+    }
+  }
+}
+
+.mt10 {
+  margin: 10px 0 0 !important;
+  background-color: #eee;
+}
+
+.courseware-tree {
+  display: flex;
+  flex: 1;
+  flex-direction: column;
+  row-gap: 8px;
+  max-height: calc(100vh - 200px);
+  overflow: auto;
+
+  .menu-item {
+    display: flex;
+    align-items: center;
+
+    &:not(.courseware) {
+      font-weight: bold;
+    }
+
+    &.courseware {
+      &:hover {
+        .name {
+          background-color: #f3f3f3;
+        }
+      }
+    }
+
+    .svg-icon {
+      margin-left: 4px;
+
+      &.my-edit-task {
+        color: $right-color;
+      }
+    }
+
+    .name {
+      flex: 1;
+      padding: 4px 8px 4px 4px;
+      border-radius: 4px;
+    }
+
+    &.active {
+      .name {
+        font-weight: bold;
+        color: #4095e5;
+      }
+    }
+  }
+}
+</style>
+
+<style lang="scss">
+.tox-tinymce-aux {
+  z-index: 9999 !important;
+}
+</style>

+ 44 - 0
packages/index.js

@@ -0,0 +1,44 @@
+import Vue from 'vue';
+import '@/styles/font/font.css';
+
+import ElementUI from 'element-ui';
+import 'element-ui/lib/theme-chalk/index.css';
+
+import '@/icons';
+
+import '@/utils/mathjax'; // 必须在引入mathjax前引入mathjax的配置文件
+import 'mathjax/es5/tex-mml-chtml';
+
+import VueSignaturePad from 'vue-signature-pad';
+
+import BookEep from './BookEep.vue';
+
+const components = [BookEep];
+
+Vue.use(ElementUI, {
+  size: 'small',
+});
+Vue.use(VueSignaturePad);
+
+// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
+const install = (VueInstance) => {
+  if (install.installed) return;
+  install.installed = true;
+
+  components.forEach((component) => {
+    VueInstance.component(component.name || 'BookEep', component);
+  });
+};
+
+// 判断是否是直接引入文件,如果是,就不用调用 Vue.use()
+if (typeof window !== 'undefined' && window.Vue) {
+  install(window.Vue);
+}
+
+// 导出的对象必须具有 install,才能被 Vue.use() 方法安装
+export default {
+  install,
+};
+
+// 用户可以通过按需引入的方式来使用组件
+export { BookEep };

+ 21 - 0
packages/package.json

@@ -0,0 +1,21 @@
+{
+  "name": "eep-ui",
+  "version": "0.0.3",
+  "main": "eep/eep-ui.common.js",
+  "style": "eep/eep-ui.css",
+  "exports": {
+    ".": "./eep/eep-ui.common.js",
+    "./style.css": "./style.css"
+  },
+  "files": [
+    "eep/**/*",
+    "style.css"
+  ],
+  "peerDependencies": {
+    "vue": "^2.6.14"
+  },
+  "scripts": {
+    "lib": "npm --prefix .. run lib:pkg",
+    "pack": "npm run lib && npm pack"
+  }
+}

+ 1 - 0
packages/style.css

@@ -0,0 +1 @@
+@import './eep/eep-ui.css';

+ 5 - 0
src/main.js

@@ -20,6 +20,11 @@ import VueSignaturePad from 'vue-signature-pad';
 
 import { setupRouterGuard } from '@/router/guard';
 
+import EepUi from 'eep-ui';
+import 'eep-ui/style.css';
+
+Vue.use(EepUi);
+
 Vue.use(ElementUI, {
   size: 'small',
 });

+ 1 - 1
src/router/guard/index.js

@@ -4,7 +4,7 @@ import NProgress from 'nprogress';
 import 'nprogress/nprogress.css';
 NProgress.configure({ showSpinner: false });
 
-const whiteList = ['/login', '/image_change', '/register']; // 重定向白名单
+const whiteList = ['/login', '/register']; // 重定向白名单
 
 // 用户类型对应的跳转路径
 export const userTypeToJump = {

+ 2 - 2
src/views/book/courseware/create/components/base/common/SelectResource.vue

@@ -4,8 +4,8 @@
     title="选择资源"
     :visible="visible"
     :close-on-click-modal="false"
-    @close="dialogClose"
     append-to-body
+    @close="dialogClose"
   >
     <div class="search-box">
       <div class="search-left">
@@ -13,7 +13,7 @@
         <el-button type="primary" @click="queryList()">查询</el-button>
       </div>
       <div class="search-content-box">
-        <div class="search-right" v-if="fromPage">
+        <div v-if="fromPage" class="search-right">
           <label>类型:</label>
           <el-select v-model="type_index" placeholder="请选择" @change="queryList()">
             <el-option v-for="item in type_list" :key="item.value" :label="item.label" :value="item.value" />

+ 0 - 1
src/views/book/courseware/preview/components/dialogue_article/index.vue

@@ -252,7 +252,6 @@ import Practice from './Practicechs.vue'; // 语音练习模式
 import WordModel from './WordModelChs.vue'; // 语音练习模式
 import Voicefullscreen from '../article/Voicefullscreen.vue';
 import { getToken } from '@/utils/auth';
-import { GetFileURLMap } from '@/api/app';
 import { analysSubmit, getSysConfig } from '@/api/article';
 import NewWordPreview from '../new_word/NewWordPreview.vue';
 import NotesPreview from '../notes/NotesPreview.vue';

+ 13 - 9
src/views/login/index.vue

@@ -112,7 +112,7 @@
             <h2>欢迎登录</h2>
             <p class="sub">登录您的账号</p>
           </div>
-          <div class="role-tabs" id="roleTabs">
+          <div id="roleTabs" class="role-tabs">
             <div class="role-tab" :class="[form.user_type === 'USER' ? 'active' : '']" @click="switchRole('USER')">
               机构用户
             </div>
@@ -151,9 +151,9 @@
             <el-form-item prop="verification_code_image_text" class="verification-code" label="验证码">
               <el-input
                 v-model="form.verification_code_image_text"
-                @keyup.enter.native="signIn"
                 prefix-icon="el-icon-finished"
                 placeholder="请输入验证码"
+                @keyup.enter.native="signIn"
               />
               <el-image
                 v-if="image_content_base64.length > 0"
@@ -267,15 +267,19 @@ export default {
   },
   methods: {
     updateVerificationCode() {
-      GetVerificationCodeImage().then(({ image_id, image_content_base64: image }) => {
-        this.form.verification_code_image_id = image_id;
-        this.image_content_base64 = image;
-      });
+      GetVerificationCodeImage()
+        .then(({ image_id, image_content_base64: image }) => {
+          this.form.verification_code_image_id = image_id;
+          this.image_content_base64 = image;
+        })
+        .catch((err) => {});
     },
     getLogo() {
-      GetLogo().then((res) => {
-        setConfig(res);
-      });
+      GetLogo()
+        .then((res) => {
+          setConfig(res);
+        })
+        .catch((err) => {});
     },
 
     signIn() {

+ 13 - 1
vue.config.js

@@ -9,6 +9,13 @@ function resolve(dir) {
 }
 
 const NODE_ENV = process.env.NODE_ENV;
+const isLibBuild = process.argv.some((arg, index, argv) => {
+  if (arg === '--target') {
+    return argv[index + 1] === 'lib';
+  }
+
+  return arg === '--target=lib';
+});
 
 const port = process.env.port || 9564;
 
@@ -32,6 +39,8 @@ if (NODE_ENV === 'development') {
 }
 
 module.exports = defineConfig({
+  // 仅在库构建时转译 node_modules,避免外部项目解析 eep-ui.common.js 时报 ?. / ?? 语法错误
+  transpileDependencies: isLibBuild ? true : [],
   publicPath: NODE_ENV === 'development' ? '/' : './',
   outputDir: 'dist',
   assetsDir: 'static',
@@ -60,6 +69,9 @@ module.exports = defineConfig({
   },
   configureWebpack: {
     name,
+    // 在库模式下,入口输出文件名是固定的(例如 eep-ui.umd.js)。
+    // 使用唯一的区块文件名以防止异步区块发生冲突。
+    output: isLibBuild ? { chunkFilename: 'eep-ui.[name].[contenthash:8].js' } : {},
     // 配置路径别名
     resolve: {
       alias: {
@@ -126,7 +138,7 @@ module.exports = defineConfig({
       })
       .end();
 
-    config.when(NODE_ENV !== 'development', () => {
+    config.when(NODE_ENV !== 'development' && !isLibBuild, () => {
       config.optimization.splitChunks({
         chunks: 'all',
         cacheGroups: {