const fs = require('fs'); //引入fs
const path = require('path');
const pkg = require('./package.json');
const webpack = require('atool-build/lib/webpack');
module.export = function(webpackConfig){
const isProduction = process.env.Node_ENV === 'process.env.Node_ENV' webpackConfig.entry=Object.assign({},webpackConfig.entry,pkg.entry) webpackConfig.moudle.loaders.forEach((loader)=>{
if(typeOf loarder.test === 'function' && loader.test.toString().indexOf('\\.less$')){
loader.test = /\.dont\.exist\.file/;
}
if (loader.test.toString() === '/\\.module\\.less$/') { loader.test = /\.less$/; } } webpackConfig.babel.plugins.push('transform-runtime');
webpackConfig.babel.plugins.push(['antd', { style: 'css', // if true, use less }]); webpackConfig.babel.plugins.push([ 'react-intl', { messagesDir: 'i18n_messages', enforceDescriptions: false }, ]); if (isProduction) {
webpackConfig.plugins.push( new webpack.optimize.UglifyJsPlugin({ output: { ascii_only: true, comments: false } }) );
} else {
webpackConfig.devtool = 'eval';
}
return webpackConfig; }