Skip to content

Commit fcebc4e

Browse files
committed
✨ remote add templateSuffix config
1 parent 3926b4c commit fcebc4e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/san-cli-build/getWebpackConfig.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,16 @@ module.exports = function getNormalizeWebpackConfig(api, projectConfigs, argv) {
6363
if (remote) {
6464
const DeployPlugin = require('deploy-files/webpack-plugin');
6565
// 从 env 文件中读取 remote 配置,这样可以将 env.local 加到 .gitignore 中防止提交
66-
// 详细配置:https://github.com/jinzhan/deploy-files
66+
// 详细配置:https://github.com/wanwu/deploy-files
6767
// host: 'http://YOUR_HOST'
6868
// receiver: 'http://YOUR_HOST/receiver',
6969
// templatePath: '/home/work/nginx_static/html/test/template',
70+
// templateSuffix: '.html',
7071
// staticPath: '//home/work/nginx_static/html/test/static',
7172
// staticDomain: 'http://test.com:8888'
7273
// baseUrl: 'https://s.bdstatic.com/'
7374
const upperRemote = remote.toUpperCase();
74-
const requiredParam = ['templatePath', 'staticPath', 'staticDomain', 'baseUrl'];
75+
const requiredParam = ['templatePath', 'staticPath', 'staticDomain', 'baseUrl', 'templateSuffix'];
7576
const remoteObj = {
7677
// 1. 默认取false;
7778
// 2. process.env读取的内容为string,需转boolean
@@ -83,7 +84,7 @@ module.exports = function getNormalizeWebpackConfig(api, projectConfigs, argv) {
8384
// templatePath → TEMPLATE_PATH
8485
const upperKey = key.replace(/[A-Z]/g, $1 => `_${$1}`).toUpperCase();
8586
const val = process.env[`SAN_REMOTE_${upperRemote}_${upperKey}`];
86-
if (!val) {
87+
if (key !== 'templateSuffix' && !val) {
8788
error(
8889
/* eslint-disable max-len */
8990
`Use --remote ${remote} to upload files, but donot get ${chalk.red(

0 commit comments

Comments
 (0)