# @extfans/cli

> extfans扩展构建工具

Latest version **1.0.0** (published 2019-03-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install @extfans/cli
pnpm add @extfans/cli
yarn add @extfans/cli
bun add @extfans/cli
```

Provides the commands `extfans-cli`, `extfans-cli-dev`, `extfans-cli-init`, `extfans-cli-build`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-03-05 |
| First published | 2019-03-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 22 |
| Unpacked size | 18.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | extfans |
| Maintainers | butsalt, infinitynewtab |

## Links

- npm: https://www.npmjs.com/package/@extfans/cli
- Repository: https://github.com/extfans/extfans-cli
- Homepage: https://github.com/extfans/extfans-cli#readme
- Issues: https://github.com/extfans/extfans-cli/issues
- npm.io page: https://npm.io/package/@extfans/cli

## Dependencies (22)

- [gulp](https://npm.io/package/gulp.md) 4.0.0
- [less](https://npm.io/package/less.md) 3.9.0
- [chalk](https://npm.io/package/chalk.md) 2.4.2
- [rimraf](https://npm.io/package/rimraf.md) 2.6.3
- [webpack](https://npm.io/package/webpack.md) 4.28.4
- [jsonfile](https://npm.io/package/jsonfile.md) 5.0.0
- [commander](https://npm.io/package/commander.md) 2.19.0
- [css-loader](https://npm.io/package/css-loader.md) 2.1.0
- [vue-loader](https://npm.io/package/vue-loader.md) 15.5.1
- [file-loader](https://npm.io/package/file-loader.md) 3.0.1
- [less-loader](https://npm.io/package/less-loader.md) 4.1.0
- [autoprefixer](https://npm.io/package/autoprefixer.md) 9.4.4
- [gulp-replace](https://npm.io/package/gulp-replace.md) 1.0.0
- [webpack-merge](https://npm.io/package/webpack-merge.md) 4.2.1
- [postcss-loader](https://npm.io/package/postcss-loader.md) 3.0.0
- [vue-style-loader](https://npm.io/package/vue-style-loader.md) 4.1.2
- [html-webpack-plugin](https://npm.io/package/html-webpack-plugin.md) 3.2.0
- [terser-webpack-plugin](https://npm.io/package/terser-webpack-plugin.md) 1.2.1
- [vue-template-compiler](https://npm.io/package/vue-template-compiler.md) 2.5.21
- [mini-css-extract-plugin](https://npm.io/package/mini-css-extract-plugin.md) 0.5.0
- [friendly-errors-webpack-plugin](https://npm.io/package/friendly-errors-webpack-plugin.md) 1.7.0
- [optimize-css-assets-webpack-plugin](https://npm.io/package/optimize-css-assets-webpack-plugin.md) 5.0.1

## Recent versions

- 1.0.0 (latest) — 2019-03-05

## README

# extfans 扩展构建工具

## node版本要求
10.9.0

## 构建流程
1. 清理`dist`目录
2. 复制国际化及图标文件到`dist`
3. 生成扩展manifest临时文件
4. 读取extfans cli配置
5. 根据manifest临时文件和extfans cli配置中描述的路径生成webpack entry
6. 执行webpack打包
7. 根据webpack打包结果，替换manifest临时文件中的路径生成正式的manifest.json

## 预定义的webpack env
* process.env.BROWSER(当运行`extfans-cli dev chrome`时，process.env.BROWSER === 'chrome')
* process.env.NODE_ENV(dev时为`development`，build时为`production`)

## 预定义的webpack alias
* @(相当于browser/base/src)
* ~(相当于browser/${process.env.BROWSER}/src)
* @extfans/lib(相当于@extfans/lib/src)

## webpack entry point收集流程
1. 生成`manifest.json`，收集文件中以`@/`或`~/`开始的路径，比如`@/pages/newtab.html`
2. 生成extfans cli配置，记录`webpackPoints`下保存的路径
3. 将路径转化为entry point，比如`@/pages/newtab.html`->`browser/base/src/pages/newtab/index.js`，如果目录下还存在`index.html`就作为该页面对应的html模板传递给`HtmlWebpackPlugin`

## 使用中的项目
1. http://git.infinitynewtab.com/Starlab/extfans-weather-extension

---
_Source: https://npm.io/package/@extfans/cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
