@forchange/cli-service
## 模式
Last updated 3 months ago by emtpzh .
ISC · Original npm · Tarball · package.json
$ cnpm install @forchange/cli-service 
SYNC missed versions from official npm registry.

cli-service

模式

开发模式

cli-service dev

构建模式

cli-service build --mode production

项目配置

通过项目根目录的pack.config.js文件对项目进行配置。

mode可以指定构建环境,对应的环境可以指定一些参数,环境无定义的参数,则取common中的值。

var path = require('path')
module.exports = {
  // 构建时会覆盖被合并到配置中
  webpackConfig: {
    context: __dirname,
    entry: {
      app: path.resolve(__dirname, 'src/app/index.ts')
    },
    resolveLoader: {
      modules: [path.resolve(__dirname, 'src'), path.resolve(__dirname, 'node_modules')]
    },
    resolve: {
      modules: [path.resolve(__dirname, 'src'), path.resolve(__dirname, 'node_modules')],
      alias: {
        app: path.resolve('src/app')
      }
    }
  },
  common: {
    title: 'vue template',
    indexTemplate: path.resolve(__dirname, 'src/index.html'),
    indexOutput: path.resolve(__dirname, 'dist/index.html'),
    staticOriginDirctory: path.resolve(__dirname, 'src/app/static'),
    assetsRoot: path.resolve(__dirname, 'dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '//acdnpy.pandateacher.com/',
    bundleAnalyzerReport: false
  },
  production: {
    sourceMap: true,
    bundleAnalyzerReport: false
  },
  debug: {
    sourceMap: true,
    bundleAnalyzerReport: false
  },
  development: {
    port: 8085,
    indexOutput: 'index.html',
    autoOpenBrowser: false,
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {},
    sourceMap: true
  }
}

TODO

  1. 整理依赖
  2. 配置文件路径可修改
  3. 完善各命令功能
  4. 完善配置说明

Current Tags

  • 0.2.2                                ...           latest (3 months ago)

2 Versions

  • 0.2.2                                ...           3 months ago
  • 0.2.1                                ...           7 months ago
Maintainers (3)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 6
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |