mirror of
https://github.com/axios/axios.git
synced 2026-04-11 14:21:59 +08:00
Co-authored-by: parth0105pluang <98079965+parth0105pluang@users.noreply.github.com> Co-authored-by: Jay <jasonsaayman@gmail.com>
27 lines
573 B
JavaScript
27 lines
573 B
JavaScript
var config = {};
|
|
|
|
function generateConfig(name) {
|
|
var compress = name.indexOf('min') > -1;
|
|
var config = {
|
|
entry: './index.js',
|
|
output: {
|
|
path: __dirname + '/dist/',
|
|
filename: name + '.js',
|
|
sourceMapFilename: name + '.map',
|
|
library: 'axios',
|
|
libraryTarget: 'umd',
|
|
globalObject: 'this'
|
|
},
|
|
node: false,
|
|
devtool: 'source-map',
|
|
mode: compress ? 'production' : 'development'
|
|
};
|
|
return config;
|
|
}
|
|
|
|
['axios', 'axios.min'].forEach(function (key) {
|
|
config[key] = generateConfig(key);
|
|
});
|
|
|
|
module.exports = config;
|