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?

More than 5 years have passed since last update.

Ionic Vue でwebpackの設定をカスタマイズする

0
Last updated at Posted at 2021-06-15

色々調べたがなかなか出てこなかったのでファイル全文検索でwebpack.configを探した

下記にあるらしい

@vue/cli-service/webpack.config

よくよく考えれば、 vue-cli-service build をやってるのだから上記にあるのは当たり前ですな。。。

(なぜか思い至らなかった。)

node_modules にあるので読み込んでオーバーライドする

よくあるやつなのですが。
プロジェクトディレクトリに config/webpack.config.js を作ります。
↑ まちがいでした。
プロジェクトディレクトリに vue.config.js を作ります。

~/vue.config.js
// もとの設定読み込み
// eslint-disable-next-line @typescript-eslint/no-var-requires
const webpackConfig = require('@vue/cli-service/webpack.config')

module.exports = {
    configureWebpack: {
        ...webpackConfig,
        ...{
            devtool: false, // eval しない
        }
    }
}

カスタマイズした設定を使うように設定する

プロジェクトの package.json に加える。
これは昔からあったやつですね。
必要ないです。

ビルドしてみて確認する

eval されなくなった。OK!(されてなかった)

追記

修正版で、キチンとevalされてないこと確認できますた。
サーセン。

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?