├── .gitignore ├── Gruntfile.js ├── LICENSE ├── README.md ├── addJS.js ├── addJS.min.js ├── bin └── addjs ├── package.json ├── src ├── config.temp.json ├── index.js ├── install.js └── lib │ ├── combine.js │ ├── combineTarget.js │ ├── config.js │ ├── server.js │ └── utils.js ├── test ├── config.js ├── css │ ├── home.css │ ├── home.min.css │ └── scss │ │ ├── scss.css │ │ └── scss.source.css ├── demo.html └── js │ ├── a.js │ ├── a.js.map │ ├── a.min.js │ ├── a.source.js │ ├── b.js │ ├── c.js │ ├── d.js │ ├── es6 │ ├── es6.js │ ├── es6.js.map │ ├── es6.min.js │ └── t.html │ ├── home.js │ ├── home.min.js │ └── t.html └── zh.md /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *swp 3 | *.swp 4 | .gitCOMMIT_EDITMSG 5 | *.svn 6 | node_modules/* 7 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | var banner = [ 2 | '/**', 3 | '<%=pkg.name%>', 4 | '@author <%=pkg.author.name%> [<%=pkg.author.email%>]', 5 | '@fileoverview <%=pkg.description%>', 6 | '@vserion <%=pkg.version%>', 7 | '**/', 8 | '' 9 | ].join('\r\n'); 10 | 11 | module.exports = function(grunt) { 12 | grunt.initConfig({ 13 | pkg: grunt.file.readJSON('package.json'), 14 | uglify: { 15 | options: { 16 | banner: banner 17 | }, 18 | files: { 19 | src: 'addjs.js', 20 | dest: 'addjs.min.js' 21 | } 22 | } 23 | }); 24 | 25 | grunt.loadNpmTasks('grunt-contrib-uglify'); 26 | 27 | grunt.registerTask('default', [ 28 | 'uglify', 29 | ]); 30 | 31 | }; 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, xiaojue 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # addjs 2 | just combine js/css. 3 | 4 | support svn file and remote file. 5 | 6 | support transform ES6 and scss file. 7 | 8 | support source map debug ES6 source code. 9 | 10 | chinese documentation: [中文文档][1] 11 | 12 | [1]: ./zh.md 13 | 14 | ---- 15 | 16 | #usage 17 | 18 | ```bash 19 | $ npm install -g addjs 20 | ``` 21 | 22 | ```css 23 | @import('./a.css'); 24 | @import('svn:https://xxx.com.cn/b/trunk/b.css'); 25 | @import('http://cnd.xx.com/c.css'); 26 | ``` 27 | 28 | ```js 29 | //addJS source file 30 | @require('./a.js'); 31 | @require('svn:https://xxx.com.cn/b/trunk/b.js'); 32 | @require('http://cdn.xx.com/c.js'); 33 | ``` 34 | 35 | ```html 36 |
37 | 38 | 39 | 40 | 41 | 42 | 43 | ``` 44 | 45 | ```js 46 | //config.js 47 | addjs.setConfig({ 48 | debugServer:'http:127.0.0.1:7575/', 49 | debugMap:{ 50 | 'http://cdn.x.cn/addjs/index.css':'./css/index.css', 51 | 'http://cdn.x.cn/addjs/index.js':'./js/index.js' 52 | } 53 | version:'0.0.1' 54 | }); 55 | ``` 56 | 57 | ```bash 58 | $ addjs --help 59 | 60 | Usage: addjs [command]'+d.title+"
";if(c.append(n),b){var i='更多相关报道 上新浪新闻APP
"),t.push("'+e.content[0].src[1]+"
"),t.push("")}function atlasHeight(){for(var e=Math.ceil((getWidth()-24-4)/2),t=Math.floor(3*e/4)-5,n=document.querySelectorAll(".sina_tj_atlas a"),i=0;i'+a[r].title+"
'+u[0].title+""+u[0].range+"%"+u[0].value+'
'+u[1].title+""+u[1].range+"%"+u[1].value+"
'+u[c].title+"