Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Export components from module

オープン
#379 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript

調査の方向性

まず src/runtime/components/index.ts と、issue に示されている package.json の exports エントリを確認し、リンク先のリポジトリのセットアップを再現します。コンポーネントの宣言がどのように生成され、package のエントリポイントを通じて公開されるかを追跡します。明示的に import したコンポーネントが any として型付けされるのではなく、正しい型を保持すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

How can I export components from module?

For example, if I don't want to autoimport specific component or if consumer wants to import component explicitly.

I managed to find a way to export like this:

src/runtime/components/index.ts

export { default as Foo } from './foo.vue'

package.json

  ...
  "exports": {
    ...
    "./components": {
      "types": "./dist/runtime/components/index.d.ts",
      "import": "./dist/runtime/components/index.js"
    }
  },

But when I import Foo from my package, although its seems to work, the component has type any.

You can check details of my setup in this repo

主要言語
TypeScript
スター
277
フォーク
36
平均マージ
2時間 46分
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nuxt/module-builder のほかの issue

nuxt/module-builder の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。