FormidableLabs / inspectpack

An inspection tool for Webpack frontend JavaScript bundles.
MIT License
592 stars 20 forks source link

Worker error Error: No code sections found #59

Closed wellyshen closed 6 years ago

wellyshen commented 6 years ago

Hi guys, I upgraded to webpack v4 with babel 7. When I use the babelrc: false of babel-loader's option I encounter the following error and it only occurs in development:

2018-03-17 1 58 17

Here's the error snippet of my webpack config:

// ...

      {
        test: /\.jsx?$/,
        exclude: /node_modules/,
        loader: 'babel',
        options: {
          cacheDirectory: isDev,
          babelrc: false,  // <== Turn it off will cause the error
          presets: [
            ['@babel/preset-env', { modules: false, useBuiltIns: 'usage' }],
            '@babel/preset-react',
            '@babel/preset-stage-0',
            '@babel/preset-flow'
          ],
          plugins: [
            'react-hot-loader/babel',
            'loadable-components/babel',
            'lodash'
          ],
          env: { production: { plugins: ['transform-remove-console'] } }
        }
      },

// ...

Any suggestion for it?

wellyshen commented 6 years ago

Reopen on https://github.com/FormidableLabs/webpack-dashboard/issues/241