welabx-cli
welabx code pack tool
Last updated 13 days ago by welabx .
MIT · Original npm · Tarball · package.json
$ cnpm install welabx-cli -g
SYNC missed versions from official npm registry.

welab 项目脚手架

快速搭建相同配置的项目.

安装

// npm i nrm -g // 安装 nrm
// nrm add fenpm http://fenpm.xxx.com // 添加内部源
// nrm use fenpm // 切换至内部源
npm i welabx-cli -g

使用

// 1. 初始化新项目(create a new project):
welabx create
welabx create <projectName> [options]
// @param {projectName} 必传
// @param {options} -l|--local 可选参数, 用于禁止检查版本更新
// @param {options} -i|--install 可选参数, 创建项目后自动安装依赖
welabx run build
welabx run dev
welabx inspect

// 2. 切换到项目目录
cd myplugin

// 3. 安装依赖
npm install

依赖包

  • welabx-template

welabx-cli.conf 默认配置项

{
    // 公共资源请求路径
    publicPath: '/',
    // 打包输出路径
    outputDir:  'dist',
    // 静态资源输出路径
    assetsDir:  'static',
    /*
     * 支持多页面/单页面打包
    */
    pages:      {
        index: {
            entry: './src/main.js',
            // filename: 'index.html',
            // html 模板文件
            template: './public/index.html',
            // html 标题
            title: 'title',
            // favicon: '',
        },
        hello: {
            entry: './src/hello.js',
            // filename: 'index.html',
            // html 模板文件
            template: './public/index.html',
            // html 标题
            title: 'title',
            // favicon: '',
        },
    },
    // 默认情况下 babel-loader 忽略其中的所有文件 node_modules
    transpileDependencies: [
        /node_modules/,
    ],
    // sourceMap
    sourceMap: process.env.NODE_ENV === 'production' ? false : 'cheap-module-eval-source-map',
    // webpack 配置项, 链式配置webpack, 脚手架内置了部分配置项, 这里可以进行覆盖, 优先级最高!
    webpackChain(config) {
        // 在这里可以自定义 webpack 配置项
        /* config.optimization
            .splitChunks({
                cacheGroups: {},
            }); */
    },
    // 本地开发 devServer 配置
    devServer: {
        hot:                true,
        open:               true,
        quiet:              true,
        progress:           false,
        compress:           false,
        historyApiFallback: true,
        overlay:            {
            warning: true,
            errors:  true,
        },
        // proxy 支持字符串和对象方式
        // proxy: {}
    },
    // terser-webpack-plugin 配置项
    terserOptions: {},
    // 是否启用多线程进行生产编译, 默认为true
    parallel: true,
}

TODO

  • run 命令
  • npm / yarn
  • 动态配置 module.rules
  • inspect 审查当前配置项

Current Tags

  • 0.6.14                                ...           latest (13 days ago)

29 Versions

  • 0.6.14                                ...           13 days ago
  • 0.6.13                                ...           16 days ago
  • 0.6.12                                ...           16 days ago
  • 0.6.11                                ...           16 days ago
  • 0.6.10                                ...           2 months ago
  • 0.6.8                                ...           2 months ago
  • 0.6.7                                ...           2 months ago
  • 0.6.6                                ...           2 months ago
  • 0.6.5                                ...           2 months ago
  • 0.6.4                                ...           2 months ago
  • 0.6.3                                ...           2 months ago
  • 0.6.2                                ...           2 months ago
  • 0.6.1                                ...           2 months ago
  • 0.6.0                                ...           2 months ago
  • 0.5.7                                ...           2 months ago
  • 0.5.6                                ...           2 months ago
  • 0.5.5                                ...           2 months ago
  • 0.5.4                                ...           2 months ago
  • 0.5.3                                ...           2 months ago
  • 0.5.1                                ...           2 months ago
  • 0.4.0                                ...           2 months ago
  • 0.3.0                                ...           3 months ago
  • 0.2.0                                ...           3 months ago
  • 0.1.5                                ...           3 months ago
  • 0.1.4                                ...           3 months ago
  • 0.1.3                                ...           3 months ago
  • 0.1.2                                ...           3 months ago
  • 0.1.1                                ...           3 months ago
  • 0.1.0                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 76
Last Day 0
Last Week 15
Last Month 21
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |