Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

ConfigurationをNuxtConfigに変更する #4924

Merged
merged 8 commits into from
Jul 7, 2020
Merged

ConfigurationをNuxtConfigに変更する #4924

merged 8 commits into from
Jul 7, 2020

Conversation

goki90210
Copy link
Contributor

@goki90210 goki90210 commented Jul 1, 2020

👏 解決する issue / Resolved Issues

📝 関連する issue / Related Issues

⛏ 変更内容 / Details of Changes

  • @nuxt/typesのConfigurationがDeprecatedとなったためConfigurationをNuxtConfigに、Configuration as WebpackConfiguration を Configurationに変更する。
  • extendの引数の型定義が不要となるため、
    import {Configuration as WebpackConfiguration} from 'webpack'
    を削除し、これにともないwebpackを直接参照する箇所がなくなるため、packege.jsonのdevDependenciesからwebpackを削除する。

📸 スクリーンショット / Screenshots

image

@munierujp
Copy link
Contributor

munierujp commented Jul 1, 2020

NuxtConfig.build.extendに型がついているので、明示的に引数の型を指定する必要はなさそうです。

https://github.com/nuxt/nuxt.js/blob/05fe682f1db152ff9ade7dc9cc66435e19fa09d0/packages/types/config/build.d.ts#L144-L149

@goki90210
Copy link
Contributor Author

goki90210 commented Jul 2, 2020

@munierujp

NuxtConfig.build.extendに型がついているので、明示的に引数の型を指定する必要はなさそうです。

ありがとうございます。
extend(config: Configuration, _: any) {

extend(config: any, _: any) {
にしてもビルドは通りますね。
ただanyの省略はできません。
(_については使用していないのでanyで問題ない認識です。)

メリットとしては
extend(config: any, _: any) {
とすることで、webpackの参照がなくなってpackage.jsonから消しても問題がなくなるところでしょうか。
一長一短ですね。

@munierujp
Copy link
Contributor

munierujp commented Jul 2, 2020

@goki90210 以下のようにすれば、configの型が推論されませんか?

extend(config) {

@goki90210
Copy link
Contributor Author

@goki90210 以下のようにすれば、configの型が推論されませんか?

extend(config) {

@munierujp
確かに…。こうするとwebpackの直接の参照がなくなるのでpackage.jsonで縛らなくてもよくなりますね。
ありがとうございます。

@goki90210 goki90210 changed the title ConfigurationをNuxtConfigに、WebpackConfigurationをConfigurationに変更する ConfigurationをNuxtConfigに変更する Jul 2, 2020
@kaizumaki
Copy link
Collaborator

ご提案ありがとうございます!yarn.lockが激しくコンフリクトしますので、先に #4933 を採用する方向でいいでしょうか?

@goki90210
Copy link
Contributor Author

@kaizumaki
わかりました。後で合わせます。

Copy link
Collaborator

@kaizumaki kaizumaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kaizumaki kaizumaki added the ready-for-merge コードレビューが終わり、マージができるもの label Jul 6, 2020
@soutaito soutaito merged commit e0590ed into Tokyo-Metro-Gov:development Jul 7, 2020
@goki90210 goki90210 deleted the feature/4923-configure-to-nuxtconfig branch July 29, 2020 01:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ready-for-merge コードレビューが終わり、マージができるもの
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@nuxt/types の Configuration が 非推奨になった
4 participants