npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vite-chrome-extension-develop-cli

v1.0.2

Published

Quickly build the basic project structure of chrome extension development.

Downloads

1

Readme

vite-chrome-extension-develop-cli

Quickly build the basic project structure of chrome extension development.

本工具集成vite-plugin-vue-crx3插件,快速搭建基于 vite2+vue3 开发 chrome extension 的项目模板,安装相应的依赖,支持开发过程中热重载。

使用方式

安装本 cli

npm i -g vite-chrome-extension-develop-cli

使用 cli 快捷创建项目

crx init

crx 为 cli 命令,默认根据用户当前环境设置项目语言。可以使用-l 强制设置项目语言(目前支持 en、zh_CN 2 种语言):

crx init -l en

创建项目时,如果当前命令目录为空,直接在当前目录创建项目;如果不为空,会新建一个项目目录来创建项目。

开始 chrome extension 开发

默认生产的项目目录结构如下:

|-public // chrome 语言包放 public 里
|-src
|--|-manifest.json // 开发的入口文件,从中可解析真实的入口文件
|--|-assets
|--|-libs // Chrome 拓展相关的开发文件都放在一个文件夹下面
|--|--|-popup.html
|--|--|-newtab.html
|--|--|-newtab
|--|--|--|-main.js
|--|--|--|-App.vue
|--|-store // 把 store 拿出来,可以作为多页共享的数据
|--|-components // 一些常用的 vue 组件
|-vite.config.js
|-package.json
|-dist // 打包后的 Chrome 拓展源文件

可以根据自己习惯修改目录结构,Chrome extension 项目是一个多页面的 vue3 项目,修改目录结构后,在 src/manifest.json 中修改对应的源文件路径即可。

打包

在开发过程中,支持修改源文件后自动打包,并且 chrome 拓展和浏览器自动重载,使用:

npm run watch

开发完成后,要发布该拓展,使用:

npm run build