ant-tool / atool-build

:hammer: Build tool based on webpack.
391 stars 75 forks source link

How to configure atool-build tool bundle to be analysable? #310

Closed sivadass closed 6 years ago

sivadass commented 6 years ago

I want to analyse the webpack bundle, what is the preferred way to configure atool-build tool ? I am happy to use any of the following webpack analysers:

Please guide me...

soda-x commented 6 years ago

create a new file webpack.config.js


const webpack = require('atool-build/lib/webpack');

module.exports = function(webpackConfig) {
    // do whatever you want

    return webpackConfig;
}
sivadass commented 6 years ago

Thanks for your guidance, but still i couldn't generate source map.

Below is my webpack.config.js:

// Learn more on how to config.
// - https://github.com/ant-tool/atool-build#配置扩展

const webpack = require('atool-build/lib/webpack');

module.exports = function(webpackConfig) {
  devtool: 'eval-source-map';

  webpackConfig.babel.plugins.push('transform-runtime');
  webpackConfig.babel.plugins.push(['import', {
    libraryName: 'antd',
    style: 'css',
  }]);

  return webpackConfig;
};

Can you please correct me, what i am doing wrong?

soda-x commented 6 years ago
webpackConfig.devtool = 'sourcemap'
sivadass commented 6 years ago

Thank you so much @pigcan