LoginSignup
17
16

More than 5 years have passed since last update.

Webpack 4を使ってみたらビルド時に[WARNING]が出たので

Posted at

とりあえず最新構成を使用してVue × TypeScriptの開発をしようしたらWARNINGが出たのでメモを残しておきます。

環境

モジュール名 バージョン
mpm 5.7.1
Webpack 4.1.1

エラー内容

WARNING in configuration
The 'mode' option has not been set. Set 'mode' option to 'development' or 'production' to enable defaults for this environment.

原因

pagckage.jsonに本番または開発の構成を追加しないといけないらしい。

解決方法

pagckage.jsonに以下の構成を追加

"scripts": {
  "dev": "webpack --mode development",
  "build": "webpack --mode production"
}

使い方

# 開発時
npm run dev

# 本番時
npm run build

参考

公式チュートリアル

17
16
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
17
16