forked from axios/axios
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Matt Zabriskie
committed
Aug 18, 2014
1 parent
9187149
commit 729404d
Showing
5 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea | ||
*.iml | ||
node_modules |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
module.exports = function(grunt) { | ||
require('load-grunt-tasks')(grunt); | ||
|
||
grunt.initConfig({ | ||
clean: { | ||
dist: 'dist/**' | ||
}, | ||
|
||
update_json: { | ||
bower: { | ||
src: 'package.json', | ||
dest: 'bower.json', | ||
fields: [ | ||
'name', | ||
'description', | ||
'version', | ||
'homepage', | ||
'license', | ||
'keywords' | ||
] | ||
} | ||
}, | ||
|
||
karma: { | ||
options: { | ||
configFile: 'karma.conf.js' | ||
}, | ||
single: { | ||
singleRun: true | ||
}, | ||
continuous: { | ||
singleRun: false | ||
} | ||
}, | ||
|
||
webpack: generateWebpackConfig(), | ||
|
||
watch: { | ||
build: { | ||
files: ['lib/**/*.js'], | ||
tasks: ['build'] | ||
}, | ||
test: { | ||
files: ['lib/**/*.js', 'specs/**/*.js'], | ||
tasks: ['test'] | ||
} | ||
} | ||
}); | ||
|
||
grunt.registerTask('test', ['webpack:global', 'karma:single']); | ||
grunt.registerTask('build', ['webpack']); | ||
grunt.registerTask('publish', ['clean', 'test', 'build', 'update_json']); | ||
|
||
function generateWebpackConfig() { | ||
var webpack = require('webpack'); | ||
var webpackConfig = {}; | ||
var webpackBase = { | ||
entry: './index.js', | ||
output: { | ||
path: 'dist/', | ||
filename: 'axios.js', | ||
library: 'axios' | ||
}, | ||
devtool: '#inline-source-map' | ||
}; | ||
|
||
['amd', 'global'].forEach(function (key) { | ||
webpackConfig[key] = JSON.parse(JSON.stringify(webpackBase)); | ||
webpackConfig[key + '-min'] = JSON.parse(JSON.stringify(webpackBase)); | ||
webpackConfig[key + '-min'].pugins = [ | ||
new webpack.optimize.UglifyJsPlugin() | ||
]; | ||
}); | ||
|
||
webpackConfig['amd'].output.filename = 'axios.amd.js'; | ||
webpackConfig['amd'].output.libraryTarget = 'amd'; | ||
webpackConfig['amd-min'].output.filename = 'axios.amd.min.js'; | ||
webpackConfig['amd-min'].output.libraryTarget = 'amd'; | ||
webpackConfig['global-min'].output.filename = 'axios.min.js'; | ||
|
||
return webpackConfig; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "axios", | ||
"main": "./dist/axios.js", | ||
"version": "0.0.0", | ||
"homepage": "https://github.com/mzabriskie/axios", | ||
"authors": [ | ||
"Matt Zabriskie" | ||
], | ||
"description": "Lightweight Promise based XHR library", | ||
"moduleType": [ | ||
"amd", | ||
"globals" | ||
], | ||
"keywords": [ | ||
"xhr", | ||
"http", | ||
"ajax", | ||
"promise" | ||
], | ||
"license": "MIT", | ||
"ignore": [ | ||
"**/.*", | ||
"*.md", | ||
"*.iml", | ||
"example", | ||
"bower_components", | ||
"node_modules", | ||
"lib", | ||
"specs", | ||
"index.js", | ||
"karma.conf.js", | ||
"Gruntfile.js", | ||
"package.json" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "axios", | ||
"version": "0.0.0", | ||
"description": "Lightweight Promise based XHR library", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "grunt test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/mzabriskie/axios.git" | ||
}, | ||
"keywords": [ | ||
"xhr", | ||
"http", | ||
"ajax", | ||
"promise" | ||
], | ||
"author": "Matt Zabriskie", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/mzabriskie/axios/issues" | ||
}, | ||
"homepage": "https://github.com/mzabriskie/axios", | ||
"dependencies": { | ||
"es6-promise": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"grunt": "^0.4.5", | ||
"grunt-contrib-clean": "^0.6.0", | ||
"grunt-contrib-watch": "^0.6.1", | ||
"webpack": "^1.3.3-beta2", | ||
"webpack-dev-server": "^1.4.10", | ||
"grunt-webpack": "^1.0.8", | ||
"load-grunt-tasks": "^0.6.0", | ||
"karma": "^0.12.21", | ||
"karma-jasmine": "^0.1.5", | ||
"grunt-karma": "^0.8.3", | ||
"karma-phantomjs-launcher": "^0.1.4", | ||
"karma-jasmine-ajax": "^0.1.4", | ||
"grunt-update-json": "^0.1.3" | ||
} | ||
} |