提交 729404df 编写于 作者: M Matt Zabriskie

Adding project files

上级 91871496
.idea
*.iml
node_modules
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;
}
};
\ No newline at end of file
{
"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"
]
}
\ No newline at end of file
{
"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"
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册