fix: Vite 設定を native ESM 対応にする - #62
Merged
Merged
Conversation
ryuuji
marked this pull request as ready for review
August 9, 2026 13:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
Vite 設定ファイルを
.mts/.mjsに変更し、明示的な ESM として読み込まれるようにしました。設定ファイル名を参照する設定やコマンドも同期し、CommonJS のrequire/__dirnameがあった箇所はimport.meta.urlベースの同値なパス解決へ置き換えています。背景
ESM 構文の Vite 設定が CommonJS として読み込まれており、現在は Vite の変換で動くものの、
configLoader: nativeが既定化される将来バージョンでは壊れる可能性がありました。リポジトリ全体へ影響する"type": "module"は追加せず、設定ファイルだけを明示的な ESM 拡張子にしています。影響
アプリケーションコード、依存関係、ビルド設定値は変更していません。生成物の全ファイルについて変更前後の内容ハッシュが一致しているため、配信物への差分はありません。
確認
npm run buildnpm run build -- --configLoader native