@forchange/cli-service
v0.2.2
Published
## 模式
Downloads
8
Readme
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
- 整理依赖
- 配置文件路径可修改
- 完善各命令功能
- 完善配置说明