Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
14
Help us understand the problem. What is going on with this article?
@MasanoriIwakura

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

More than 3 years have passed since last update.

とりあえず最新構成を使用して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

参考

公式チュートリアル

14
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
MasanoriIwakura
フルスタックを目指しているサーバーサイド〜インフラエンジニア SIerで4年ほど消化しましたが現在はWeb系エンジニアです。 技術書典7にて書籍出したので興味がある方はご覧ください! https://booth.pm/ja/items/1555055

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
14
Help us understand the problem. What is going on with this article?