苦力——兼容 CJS、CMD 规范,任意资源类型的模块加载器。
- coolie 官方指南:https://coolie.ydr.me/
- 构建工具:https://github.com/cooliejs/coolie-cli
- 社区:http://FrontEndDev.org/
苦力 —— 前端模块加载,支持 CommonJS、CMD、AMD 规范。
Home Page: https://coolie.ydr.me/
苦力——兼容 CJS、CMD 规范,任意资源类型的模块加载器。
RT
hi~
we had used coolie as the compile tool. recently , we will upgrade the project , and es6 is really the direction face to future, so how to set babel work with coolie ?
Thanks~
link 标签的 favicon构建不生效
建议改个好区别的名。比如 coolie-config.js 和 coolie-node-config.js
1.js的合并压缩
2.css的合并压缩
3.资源(js/css/img)的cdn发布
☀︎☀︎☀︎
比如我引用一个a.js,然后希望js能够嵌入到html中,支持inline操作吗?
支持require省略.js后缀,目前市面上有很多AMD规范的库都是省略了.js后缀。
define(function(require,exports,module){
require('../lib/juqery/jquery.min.js');
require('../lib/webuploader/webuploader.html5only.min.js');
require('../lib/webuploader/webuploader.css','css|url');
// require('jquery');
// require('webuploader');
var fileBtn;
function uploader(container){
this.container = $(container);
}
module.exports = uploader;
uploader.prototype.render = function(){
this._uploader();
}
uploader.prototype._uploader = function(){
var container = this.container;
$(container).each(function(){
var $list = $(this).siblings('.uploader-list');
// 初始化Web Uploader
var uploader = new WebUploader.Uploader({
// 选完文件后,是否自动上传。
auto: true,
// 文件接收服务端。
server:'http://webuploader.duapp.com/server/fileupload.php',
// 选择文件的按钮。可选。
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
pick: this,
//可以上传同样的文件
duplicate : true,
// 只允许选择图片文件。
accept: {
title: 'Images',
extensions: 'gif,jpg,jpeg,bmp,png',
mimeTypes: 'image/*'
},
//单个文件大小2M
fileSingleSizeLimit:2*1024*1024
});
...
});
}
})
用coolie 加载jquery和webuploader(在外层加了define(function(require,exports,module){})包装)。用google看,Network加载没有问题。但是报(Uncaught ReferenceError: WebUploader is not defined)
// 初始化Web Uploader
var uploader = new WebUploader.Uploader
如果代码不变,仅仅换为sea.js加载,就不会报错,可以正常运行,求问这是怎么回事?
使用 require.async 异步加载 a.js, 在 a.js 异步加载未完成时, 第二次 异步调用 a.js 。 调试发现,两次调用的 回调函数均未被触发 。
当引用的库越来越多的时候,别名设置就显得更加的简洁了。建议后期增加。
也就是 目录到底怎么创建 如果是 跟后端java 交互 应该怎么做这些都不了解真的很希望您出一个比较健全的实例demo啊.coolie的指南里我看到有这个预留空间但是还没有内容.
文档里没看到~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.