0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Vue DevtoolsをExpress.jsから実行しても使えるようにする

Last updated at Posted at 2025-02-18

はじめに

VueのアプリをViteからではなくExpress.jsなど別のところから実行したときに、ブラウザでVue Devtoolsを開こうとすると
vue.js is detected on this page. devtools inspection is not available because it's in production mode or explicitly disabled by the author.
と出ることがあります。

プロダクション環境で実行すればいいのでしょうが、vite buildのオプションを変えてもうまくいかず、node main.js--env developmentとつけてもうまくいかず‥

調べてみると、以下のChrome拡張機能を入れると強制的に開発環境で実行されるようです。

2025.03.08追記

vite.config.tsでプロキシを設定するとサーバーへのアクセスはしつつviteのHMRの恩恵を受けられるので、開発環境ではviteからサーブしたほうが良いです。

vite.config.ts
export default defineConfig({
  //...
  server: {
    proxy: {
      "/api": {
        target: "http://localhost:8105"
      }
    }
  }
  //...
});

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?