We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
想法: 基于seajs的依赖合并是基于html页面开始的,我想不管html页面,直接基于页面js文件,通过页面js文件里的依赖关系把文件合并。
目录规范:
- pro - --json - --static - ----| images - ----| js - ------| pages - ------| plugin - ------| widget - ----| css - --view
fis-conf.js代码:
fis.set('project.files', ['/static/js/pages/**.js']); fis.match('*.js', { isMod: true }); fis.match("/static/js/core/sea.js",{ isMod:false }); fis.hook('cmd', { baseUrl: './static/', paths: { "jquery":"js/core/jquery.js", "validform": "js/plugins/validform/core.source" } }); fis.match("*",{ deploy:fis.plugin("local-deliver",{ to:"../prod/pro1" }) }); fis.match('::packager', { postpackager: fis.plugin('loader', { allInOne: { includeAsyncs: true, ignore: ['/static/js/core/sea.js'] } }) });
原页面js代码:
define(function(require, exports, module) { require("jquery"); require("validform"); });
生成的页面js代码
define('static/js/pages/test', ["static/js/core/jquery", "static/js/plugins/validform/core.source"], function(require, exports, module) { require("static/js/core/jquery"); require("static/js/plugins/validform/core.source"); });
没有根据require把jquery与validform两个文件合并进来。
当我基于html
fis.set('project.files', ['*.html']);
这样的时候就可以把jquery与validform合并进来。
请指教,谢谢。
The text was updated successfully, but these errors were encountered:
这个不行的吗?
Sorry, something went wrong.
那个合并是 loader 插件分析页面资源后自动合并的,注意是页面。
如果你的项目没有 html, 而是直接想把 js 合并起来,你可以用这个插件实现。https://github.com/fex-team/fis3-packager-deps-pack
@2betop thx,我先看下那个插件。
No branches or pull requests
想法:
基于seajs的依赖合并是基于html页面开始的,我想不管html页面,直接基于页面js文件,通过页面js文件里的依赖关系把文件合并。
目录规范:
fis-conf.js代码:
原页面js代码:
生成的页面js代码
没有根据require把jquery与validform两个文件合并进来。
当我基于html
这样的时候就可以把jquery与validform合并进来。
请指教,谢谢。
The text was updated successfully, but these errors were encountered: