Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
fix: 移除 options 中的 default,在运行时动态判断以避免 CI 错误
Browse files Browse the repository at this point in the history
  • Loading branch information
inJs authored and yesmeck committed May 20, 2020
1 parent ec7b67e commit 6bec914
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/remax-cli/src/build/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function buildWeb(api: API, options: Options): webpack.Compiler {
const compiler = webpack(webpackOptions);

if (options.watch) {
const designatedPort = options.port;
const designatedPort = options.port ?? 3000;

detect(designatedPort, (err, port) => {
if (err) {
Expand Down
1 change: 0 additions & 1 deletion packages/remax-cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export function run(args: any, callback?: yargs.ParseCallback) {
describe: '指定端口号',
alias: 'p',
type: 'number',
default: 3000,
})
.showHelpOnFail(false);

Expand Down
2 changes: 1 addition & 1 deletion packages/remax-types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface Options {
UNSAFE_wechatTemplateDepth: number | { [key: string]: number };
configWebpack?: (params: { config: WebpackConfig; webpack: any }) => void;
plugins: Plugin[];
port: number;
port?: number;
one?: boolean;
notify?: boolean;
watch?: boolean;
Expand Down

0 comments on commit 6bec914

Please sign in to comment.