5
2

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.

WSLでNuxt.jsのgenerate時に91%で止まる

Posted at

generateが止まる

題名通り、自分はWindowsのWSL(Ubuntu18.04)を利用して開発を行っています。
たまにgenerateが重いときはあったのですが、今回完全に91%で止まるようになったので調査しました。

Nuxt.jsのissueにて同じ悩みを抱えている方がいたためすぐに解決しました。

Pluginのインストール

まずは圧縮用のツールのプラグインであるterser-webpack-pluginをインストールします。

Node.js
npm i -D terser-webpack-plugin 

configファイルの編集

インストールしたterserを使うようにconfigファイルを編集

nuxt.config.js
import TerserPlugin from 'terser-webpack-plugin'
module.exports = {

//省略

  build: {
    optimization: {
      minimize: true,
      minimizer: [
        new TerserPlugin({
          cache: true,
          parallel: false
        })
      ]
    }
  }
//省略
}

終わりに

何かあったときは落ち着いてissueを見る。

5
2
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
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?