sov-cli-service

基于 vue-cli-service, puma 提供增量编译

Usage no npm install needed!

<script type="module">
  import sovCliService from 'https://cdn.skypack.dev/sov-cli-service';
</script>

README

扩展脚手架

基于 vue-cli-service, puma 提供增量编译

安装

npm install @jd/jnpm -g --registry=http://registry.m.jd.com
jnpm install @jdd/puma-cli -g
jnpm install sov-cli-service --save-dev

注意:

  • puma 需要安装 0.2.3 及以上版本;
  • nodejs 需要 10.0.0 及以上版本。

使用

node node_modules/sov-cli-service --dist dist --cdnRoot //unipay-res.jd.com/dlb-b-customer-m-vue --publicPath /m-cust

需要编辑 vue.config.js 文件,动态接收编译参数

// 获得外部传入的静态资源目录
let assetsDir = "v0.0.0";
for (let i = 0; i < process.argv.length; i++) {
    if (process.argv[i] === '--assetsDir') {
        assetsDir = process.argv[i + 1];
    }
}

// 发布参数
module.exports = {
    devServer: {
        disableHostCheck: true,
        port: 80,
        open: true
    },
    assetsDir,
    productionSourceMap: false,
    publicPath: "/m-cust/"
};