티스토리 뷰

 

 

webpack-bundle-analyzer

 

GitHub - webpack-contrib/webpack-bundle-analyzer: Webpack plugin and CLI utility that represents bundle content as convenient in

Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap - GitHub - webpack-contrib/webpack-bundle-analyzer: Webpack plugin and CLI utility that repr...

github.com

 

 

이유는 webpack-derServer을 이용하고 있기 때문인데요 

 

에러 메세지

No bundles were parsed. Analyzer will show only original module sizes from stats file.

stat만 보이는 모습

 

 

해결 방법으로는 webpack-devServer을 사용하지 않으면 됩니다

 

webpack.analyzer.js

const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const { merge } = require('webpack-merge');

const common = require('./webpack.common.js');

module.exports = merge(common, {
  plugins: [new BundleAnalyzerPlugin()],
  mode: 'production', // 현재 배포 모드
  devtool: 'hidden-source-map', // 느리지만 안전 배포에 추천
});

 

package.json

  "scripts": {
    ...,
    "check-bundle": "webpack --config webpack.analyzer.js"
  },

 

적용 후 잘 나오는 모습

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
글 보관함