@kokojs/plugin-vue

`@kokojs/plugin-vue` 提供了编译 .vue 单文件组件的能力,并内置 Vue 基础 DLL。
17,024
Install
npm install @kokojs/plugin-vue
Latest Version:4.0.36
License:MIT
Last Updated:Dec 8, 2025
Links: Repository  ·  npm
Maintainer: chenjiahan

Vue 插件

@kokojs/plugin-vue 提供了编译 .vue 单文件组件的能力,并内置 Vue 基础 DLL。

安装

yarn add @kokojs/plugin-vue --dev

安装完成后,在 koko.config.js 中添加如下配置:

module.exports = {
  plugins: {
    vue: {},
  },
};

内置 DLL

Vue 插件内置的 DLL 中包含了以下内容:

  • vue
  • vuex
  • vue-router
  • vue-lazyload

Tips: 如果项目中没有安装上述的库,他们将不会被打包进 DLL 中。

DLL 缓存

koko-plugin-vue 开启了 DLL 缓存的功能,并将依赖库的版本号作为 cacheKey,依赖库的版本号未变化时,会直接使用上次构建的 DLL 缓存结果。

配置项

dll

  • Type: boolean
  • Default: true

是否需要构建内置 DLL,如果设置为 false,将不会生成 Framework DLL。

module.exports = {
  plugins: {
    vue: {
      dll: false,
    },
  },
};

维护者

陈嘉涵。

Version History

Version Released License
4.0.36 MIT
4.0.35 MIT
4.0.34 MIT
4.0.33 MIT
4.0.32 MIT
Pre-releases (227)
Version Released License
4.0.36-beta.20251104103718.0 MIT
4.0.36-beta.20251030202547.0 MIT
4.0.35-beta.20250828103910.0 MIT
4.0.35-beta.20250827170231.0 MIT
4.0.33-beta.20250224142420.0 MIT