npm

@deot/dev-dever
TypeScript icon, indicating that this package has built-in type declarations

2.8.2 • Public • Published

@deot/dev-dever

开发

  • 优先执行scripts下的dev

自定义配置

提供环境变量DEV_OPTIONS

interface DEV_OPTIONS {
	packageFolderName?: string;
	workspace?: string;
	entries: string[];
	html: string;
}

根目录创建dev.config.ts, 可以选择configShared合并或单独基于DEV_OPTIONS配置

也可以是z.dev.config.ts, 前缀主要是置底

import { mergeConfig, defineConfig } from 'vite';
import type { UserConfig } from 'vite';
import configShared from './node_modules/@deot/dev-dever/shared.config'; // 这样调用时才会被编译

export default mergeConfig(
	configShared,
	defineConfig({
		plugins: [
			vue(),
			react()
		]
	}) as UserConfig
);

dev.config.ts, 是为了方便从vite转其他开发工具时,可以不改变文件名

预加载配置preload.ts

会查找当前文件夹路径下往前查找preload.ts文件,直至process.cwd(),如果存件,就近添加preload.ts

文件查找优先级

  • z.dev.preload.ts
  • dev.preload.ts
  • z.preload.ts
  • preload.ts

Readme

Keywords

none

Package Sidebar

Install

npm i @deot/dev-dever

Weekly Downloads

2

Version

2.8.2

License

MIT

Unpacked Size

26.3 kB

Total Files

7

Last publish

Collaborators

  • deot