From 89a801b3d7d8ce6bacdad18a612d33da726e58b9 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Tue, 7 Sep 2021 20:38:02 +0800 Subject: [PATCH] fix: failed to register cli bin --- .gitignore | 2 +- packages/vant-cli/bin.js | 2 ++ packages/vant-cli/changelog.md | 1 + packages/vant-cli/package.json | 3 ++- packages/vant-cli/src/{bin.ts => cli.ts} | 1 - 5 files changed, 6 insertions(+), 3 deletions(-) create mode 100755 packages/vant-cli/bin.js rename packages/vant-cli/src/{bin.ts => cli.ts} (98%) diff --git a/.gitignore b/.gitignore index d289e8711..e7fa2a6cb 100644 --- a/.gitignore +++ b/.gitignore @@ -16,5 +16,5 @@ es lib dist vetur -**/site +**/site-dist changelog.generated.md diff --git a/packages/vant-cli/bin.js b/packages/vant-cli/bin.js new file mode 100755 index 000000000..50cba5b2b --- /dev/null +++ b/packages/vant-cli/bin.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('./lib/cli'); diff --git a/packages/vant-cli/changelog.md b/packages/vant-cli/changelog.md index d55757de6..57118d6db 100644 --- a/packages/vant-cli/changelog.md +++ b/packages/vant-cli/changelog.md @@ -8,6 +8,7 @@ - 站点构建产物的目录由 `site` 调整为 `site-dist` - 不再支持 webpack.config.js 配置文件 - 不再支持 less import 语法中使用波浪号 +- 不再在 demo 文件中自动注册组件 - 移除 build 命令的 --watch 参数 - 移除内置的 babel-plugin-import 插件 - 由于不再使用 html-webpack-plugin, 因此移除了 site.htmlPluginOptions 配置项 diff --git a/packages/vant-cli/package.json b/packages/vant-cli/package.json index ccd13f87a..818e11cf6 100644 --- a/packages/vant-cli/package.json +++ b/packages/vant-cli/package.json @@ -4,7 +4,7 @@ "main": "lib/index.js", "typings": "lib/index.d.ts", "bin": { - "vant-cli": "./lib/bin.js" + "vant-cli": "./bin.js" }, "engines": { "node": ">=12" @@ -22,6 +22,7 @@ "lib", "site", "template", + "bin.js", "preset.js" ], "keywords": [ diff --git a/packages/vant-cli/src/bin.ts b/packages/vant-cli/src/cli.ts similarity index 98% rename from packages/vant-cli/src/bin.ts rename to packages/vant-cli/src/cli.ts index 82d4cbbc4..a5bb52e67 100644 --- a/packages/vant-cli/src/bin.ts +++ b/packages/vant-cli/src/cli.ts @@ -1,4 +1,3 @@ -#!/usr/bin/env node import { Command } from 'commander'; import {