mirror of
https://github.com/axios/axios.git
synced 2026-04-11 02:11:50 +08:00
* Revert "Update Webpack + deps, remove now unnecessary polyfills (#2410)"
This reverts commit 189b34c45a.
* Fix build (#2496)
* Change syntax to see if build passes
* Test commit
* Test with node 10
* Test adding all browsers in travis
* remove other browsers when running on travis
45 lines
833 B
JavaScript
45 lines
833 B
JavaScript
var webpack = require('webpack');
|
|
var config = {};
|
|
|
|
function generateConfig(name) {
|
|
var uglify = name.indexOf('min') > -1;
|
|
var config = {
|
|
entry: './index.js',
|
|
output: {
|
|
path: 'dist/',
|
|
filename: name + '.js',
|
|
sourceMapFilename: name + '.map',
|
|
library: 'axios',
|
|
libraryTarget: 'umd'
|
|
},
|
|
node: {
|
|
process: false
|
|
},
|
|
devtool: 'source-map'
|
|
};
|
|
|
|
config.plugins = [
|
|
new webpack.DefinePlugin({
|
|
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
|
|
})
|
|
];
|
|
|
|
if (uglify) {
|
|
config.plugins.push(
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
compressor: {
|
|
warnings: false
|
|
}
|
|
})
|
|
);
|
|
}
|
|
|
|
return config;
|
|
}
|
|
|
|
['axios', 'axios.min'].forEach(function (key) {
|
|
config[key] = generateConfig(key);
|
|
});
|
|
|
|
module.exports = config;
|