plutarch
Cli tool for serve and build react app, support JSON pattern config.
Last updated a month ago by schifred .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install plutarch 
SYNC missed versions from official npm registry.

plutarch

基于 webpack4 实现的前端应用开发工具。

快速上手

## 全局或本地安装
$ cnpm i plutarch -g

## 获取版本
$ plutarch -v
3.1.17

## 创建项目
$ plutarch init # 创建项目

## 本地开发
$ plutarch server

## 打包
$ plutarch build
$ plutarch build -p 语法环境打包

## storybook
$ plutarch story

配置

webpack 配置项

选项 意义 默认值
mode 模式,区分生产环境还是开发环境,可选值为 'production' 或 'development' 'production'
template 模板所在文件夹,默认扫描源目录 undefined
entry 入口文件,默认扫描源目录中的 js tsx? 文件
output 出口 undefined
publicPath 设置 output.publicPath undefined
resolve 解析规则 undefined
alias 别名,默认扫描源目录下的文件夹 undefined
devtool sourcemap 生成规则,'development' 默认下默认 'source-map' undefined
externals 外部扩展 undefined
target 构建目标 undefined
rules 额外的加载器 undefined
module 内置加载器选项配置 undefined
splitChunksOptions 公共模块抽取,自动提取到 commons 文件内 undefined
compress 是否压缩 true
enableCssModules 是否开启 css modules false

数据模拟

通过 plutarch.mock.js 文件配置模拟数据,在dev server中直接挂载控制器实现。

  1. 函数形式
// plutarch.mock.js
module.exports = function(app){
  app.get("/api/test.json",(req,res)=>{
    res.send("test");
  });
};
  1. 对象形式
// plutarch.mock.js
module.exports = {
  "get /api/test.json": "test"
};
  1. 文件控制器形式
// plutarch.mock.js
module.exports = {
  app.get("/api/test.json","test");
};
// mocks/test.js
module.exports = function(req,res){
  res.send("test");
};

Current Tags

  • 3.1.10                                ...           latest (a month ago)

50 Versions

  • 3.1.10                                ...           a month ago
  • 3.1.9                                ...           a month ago
  • 3.1.8                                ...           a month ago
  • 3.1.7                                ...           a month ago
  • 3.1.6                                ...           a month ago
  • 3.1.5                                ...           2 months ago
  • 3.1.4                                ...           2 months ago
  • 3.1.3                                ...           2 months ago
  • 3.1.2                                ...           2 months ago
  • 3.1.1                                ...           2 months ago
  • 3.1.0                                ...           2 months ago
  • 3.0.27-alpha.0                                ...           2 months ago
  • 3.0.26                                ...           2 months ago
  • 3.0.26-alpha.0                                ...           2 months ago
  • 3.0.25                                ...           2 months ago
  • 3.0.25-alpha.0                                ...           2 months ago
  • 3.0.24                                ...           2 months ago
  • 3.0.23                                ...           2 months ago
  • 3.0.22                                ...           3 months ago
  • 3.0.21                                ...           3 months ago
  • 3.0.20                                ...           3 months ago
  • 3.0.19                                ...           3 months ago
  • 3.0.18                                ...           3 months ago
  • 3.0.17                                ...           3 months ago
  • 3.0.16                                ...           3 months ago
  • 3.0.15                                ...           3 months ago
  • 3.0.14                                ...           4 months ago
  • 3.0.13                                ...           6 months ago
  • 3.0.12                                ...           8 months ago
  • 3.0.11                                ...           9 months ago
  • 3.0.10                                ...           9 months ago
  • 3.0.9                                ...           9 months ago
  • 3.0.8                                ...           9 months ago
  • 3.0.7                                ...           9 months ago
  • 3.0.6                                ...           9 months ago
  • 3.0.5                                ...           9 months ago
  • 3.0.4                                ...           9 months ago
  • 3.0.3                                ...           9 months ago
  • 3.0.2                                ...           9 months ago
  • 3.0.1                                ...           9 months ago
  • 3.0.0                                ...           9 months ago
  • 2.0.2                                ...           a year ago
  • 2.0.1 [deprecated]           ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago

Copyright 2014 - 2016 © taobao.org |