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

make-extension

v0.8.8

Published

make browser extension with webpack

Downloads

9

Readme

扩展构建工具

install -g make-extension

node版本要求

10.9.0

构建流程

  1. 清理dist目录
  2. 复制国际化及图标文件到dist
  3. 读取browser/base/manifest.jsonbrowser/${process.env.BROWSER}/mafest.json合并后生成扩展manifest临时文件
  4. 执行browser/base/.pointrc.jsbrowser/${process.env.BROWSER}/.pointrc.js结果合并后生成此次打包过程中需要webpack额外进行编译的entry point
  5. 根据manifest临时文件和.pointrc.js的结果生成webpack entry
  6. 执行browser/base/.postcssfunctionrc.jsbrowser/${process.env.BROWSER}/.postcssfunctionrc.js结果合并后生成额外的postcss-function(用法参考)
  7. 执行webpack打包
  8. 根据webpack打包结果,替换manifest临时文件中的路径生成正式的manifest.json

预定义的webpack env

  • process.env.BROWSER(当运行make-extension dev chrome时,process.env.BROWSER === 'chrome')
  • process.env.NODE_ENV(dev时为development,build时为production)

预定义的webpack alias

  • @(相当于browser/base/src)
  • ~(相当于browser/${process.env.BROWSER}/src)

webpack entry point收集流程

  1. 生成manifest.json,收集文件中以@/~/开始的路径,比如@/pages/newtab.html
  2. 读取browser/base/.pointrc.jsbrowser/${process.env.BROWSER}/.pointrc.js记录的路径
  3. 将路径转化为entry point,比如@/pages/newtab.html->browser/base/src/pages/newtab/index.js,如果目录下还存在index.html就作为该页面对应的html模板传递给HtmlWebpackPlugin

可以使用的js草案语法

使用到的postcss plugin

注意

  • 0.5.0之前添加了babel插件plugin-proposal-decorators,考虑到会增加代码体积已在0.5.0移除

使用中的项目

  • http://git.infinitynewtab.com/Starlab/infinity-pro
  • http://git.infinitynewtab.com/Starlab/world-infinity-pro