【发布时间】:2015-06-10 04:48:03
【问题描述】:
在我的远程服务器(Ubuntu 14.04 x64)上,每当我尝试丑化我的捆绑包时,该过程只会返回“Killed”。我不丑化的时候就好了。
有人遇到过这种情况吗?当我在本地 Mac 上执行此操作时,一切正常(尽管我刚刚测试了它并花了 1.4 分钟)。
这是我的 webpack.config:
var webpack = require('webpack');
function makeConfig(opts) {
var config = {
entry: {
app: ['./public/scripts/main.js'],
vendor: ['lodash', 'react', 'react/lib/ReactCSSTransitionGroup', 'react-router', 'reqwest', 'd3']
},
stats: {
colors: true,
reasons: true
},
output: {
devtool: (opts.env === 'dev' ? '#eval-source-map' : ''),
path: 'dist/scripts',
filename: '[name].bundle.js'
},
plugins: [
new webpack.DefinePlugin({
ENV: opts.env
}),
new webpack.optimize.CommonsChunkPlugin('vendor.bundle.js')
],
module: {
loaders: [
{ test: /\.jsx?$/, loader: 'jsx-loader' }
]
}
};
if(opts.env === 'prod') {
config.plugins.push(
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.DedupePlugin()
);
}
return config;
}
module.exports = makeConfig;
它被 gulp 调用,如下所示:
gulp.task('webpack', ['cleanScripts'], function(done) {
webpack(webpackConfig, function(err, stats) {
if(err) {
console.error(err);
throw new gutil.PluginError('webpack', err);
}
else {
done();
}
});
});
【问题讨论】:
-
与 AWS 免费套餐 micro.t2 相同