vite-plugin-image-helper
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

vite-plugin-image-helper

一个 vite 插件,可以帮助开发者方便的使用图片

Size Version Languages License Star Download

安装

npm i -D vite-plugin-image-helper

添加至您的 vite.config.ts:

// vite.config.ts
import ImageHelper from "vite-plugin-image-helper";

export default {
	resolve: {
		alias: {
			"@/": `${resolve(__dirname, "src")}/`,
		},
	},
	plugins: [
		ImageHelper({
			// 配置静态资源存放的路径(可以解析配置的resolve.alias)
			path: "@/assets", // or "/src/assets" or ["@/assets", ...]
			// 配置帮助页面的端口
			port: 7747,
			// 开启websocket,若对path中的文件进行了改动,可以实时更新
			ws: true,
		}),
	],
};

之后您便可在localhost:7747打开查看

源码

源码可以在 GitHub 仓库 中找到。

贡献

如果您发现vite-plugin-image-helper中有任何问题或缺少某些功能,请随时提交问题或请求。

我们欢迎您的贡献,包括提交错误修复、添加新功能或改进文档。

Readme

Keywords

Package Sidebar

Install

npm i vite-plugin-image-helper

Weekly Downloads

4

Version

0.0.4

License

MIT

Unpacked Size

1.21 MB

Total Files

10

Last publish

Collaborators

  • wscloud