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
package.json
{ "name": "sjld-flow", "version": "0.0.1", "description": "sjldflow", "keywords": [ ], "homepage": "", "repository": { "type": "svn", "url": "" }, "bugs": { "url": "" }, "licenses": "MIT", "spm": { "output": [ "bjlbb.js" ], "dependencies": { "seajs": "2.3.0" }, "engines": { "seajs": "2.3.0" }, "ignore": ["backbone","handlebars","underscore"] } }
打包后的js一段
define("sjld-flow/0.0.1/wdsx",["backbone","handlebars","underscore"],function(t,e,n){var i=t("sjld-flow/0.0.1/mvc/view/wdsx/wdsx");n.exports=i});
t,e,n 被替换 而sea-warp源码里CMD_REG正则是要有require 才不会包 define
t,e,n
CMD_REG
wrapExec[uri] = function(uri, content) { var wrappedContent; var CMD_REG = /define\(.*function\s*\(\s*require\s*(.*)?\)\s*\{/; if (CMD_REG.test(content) || query.indexOf('nowrap') > 0) { wrappedContent= content; } else { wrappedContent = 'define(function(require, exports, module) {\n' + content + '\n})'; } wrappedContent = wrappedContent + '//# sourceURL=' + uri; globalEval(wrappedContent, uri); }
请问如何才能打包不用 替换require 或者如何才能正确执行?谢谢啦
The text was updated successfully, but these errors were encountered:
define(id, deps, factory)
提取依赖后 deps 已经不再用 require 获取了,而是直接从 define 的第二个参数获取,所以这时候压缩是不会有问题的,如果你那边报错先去检查下你的id和路径的对应关系!
sea-wrap 并不推荐线上环境用,跨域在老版本浏览器是个问题!
Sorry, something went wrong.
No branches or pull requests
package.json
打包后的js一段
t,e,n
被替换而sea-warp源码里
CMD_REG
正则是要有require 才不会包 define请问如何才能打包不用 替换require 或者如何才能正确执行?谢谢啦
The text was updated successfully, but these errors were encountered: