Javascript 如何在DOJO层中包含/预先添加版权文件?
我使用的是DOJO 1.10,我需要在文件中为层(连接的文件)包含/预先添加一些版权信息 我正在按照来自的指令,使用版权文件(.txt文件)的本地和绝对路径 没有成功 注: 此外,文档明确表示默认的Dojo版权声明将是 如果未提供版权文件属性,但“我的图层”中从未包含此文本信息,则改用此选项 我做错了什么Javascript 如何在DOJO层中包含/预先添加版权文件?,javascript,dojo,Javascript,Dojo,我使用的是DOJO 1.10,我需要在文件中为层(连接的文件)包含/预先添加一些版权信息 我正在按照来自的指令,使用版权文件(.txt文件)的本地和绝对路径 没有成功 注: 此外,文档明确表示默认的Dojo版权声明将是 如果未提供版权文件属性,但“我的图层”中从未包含此文本信息,则改用此选项 我做错了什么 var profile = function() { return { basePath: "../", releaseDir: "dist",
var profile = function() {
return {
basePath: "../",
releaseDir: "dist",
releaseName: "build",
optimize: "closure",
action: "release",
layerOptimize: "closure",
copyTests: !1,
stripConsole: "all",
version: "ntv-0.0.0",
cssOptimize: "comments",
mini: !0,
staticHasFeatures: {
"dojo-trace-api": !1,
"dojo-log-api": !1,
"dojo-publish-privates": !1,
"dojo-sync-loader": !1,
"dojo-xhr-factory": !1,
"dojo-test-sniff": !1
},
resourceTags: {
amd: function(t) {
return /\.js$/.test(t)
},
ignore: function(t) {
return /\.js.map$/.test(t)
},
miniExclude: function(t) {
return /\.js.map$/.test(t)
}
},
packages: [{
name: "dojo",
location: "dojo"
}, {
name: "test",
location: "test"
}],
layers: {
"dojo/dojo": {
include: ["dojo/dojo"],
customBase: true,
boot: false
},
"test/c": {
include: ["test/c/c"],
customBase: true,
boot: false,
copyrightFile: 'C:\copyright.txt'
},
"test/b": {
include: ["test/b/b"],
customBase: true,
boot: false,
copyrightFile: 'C:\copyright.txt'
},
"test/a": {
include: ["test/a/a"],
customBase: true,
boot: false,
copyrightFile: 'C:\copyright.txt'
}
}
}
}();
我找到了解决这个问题的临时方法,因为我正在使用Google Closure compiler,所以我可以使用
@preserve
或@license
在JavaScript中保留一些注释
下面是我在源代码中使用的示例。尽管如此,我仍然非常有兴趣使用DOJO提供的copyrightFile
/**
* @preserve Copyright 2009 SomeThirdParty.
* Here is the full license text and copyright
* notice for this file. Note that the notice can span several
* lines and is only terminated by the closing star and slash:
*/
相关的:
这一行为似乎有所改变,并且可能没有针对1.7+版本的构建概要文件进行详细记录。但是很难找到 当使用新的配置文件格式时(例如,使用
层
哈希而不是数组),属性名为版权
,而不是版权文件
,并且它似乎默认为无
例如,要将默认的Dojo版权消息添加到一个层中,您需要设置
版权:“util/build/copyright.txt”
(假设util
直接位于basePath
)下。非常感谢您的时间和帮助。我想知道你是否也可以快速看一下这个相关的问题。我真的很感谢你花时间在这个问题上。提前谢谢。