问题
I am creating a custom build in DOJO. I need to to keep in the build folder dojoConfig.js file not minified.
At the moment I am trying to:
- exclude dojoConfig.js from build using miniExclude
, this works fine work fine
- after copyOnly
to final build dojoConfig.js without compression, this does NOT work.
I need to copy dojoConfig.js in the build foler.
Any idea what is wrong in my profile?
miniExclude: function(o, e) {
return e in {
"aaa/aaa.profile": 1,
"aaa/dojoConfig": 1
}
},
copyOnly: function(o, e) {
return e in {
"aaa/dojoConfig": 1
}
}
var profile = function() {
return {
basePath: "../",
releaseDir: "dist",
releaseName: "build",
optimize: "closure",
action: "release",
layerOptimize: "closure",
copyTests: !1,
stripConsole: "all",
version: "0.0.0",
cssOptimize: "comments",
mini: !0,
copyTests: !1,
useSourceMaps: !1,
staticHasFeatures: {
"config-dojo-loader-catches": 0,
"config-tlmSiblingOfDojo": 0,
"dojo-amd-factory-scan": 0,
"dojo-combo-api": 0,
"dojo-config-api": 1,
"dojo-config-require": 0,
"dojo-debug-messages": 0,
"dojo-dom-ready-api": 1,
"dojo-firebug": 0,
"dojo-guarantee-console": 1,
"dojo-has-api": 1,
"dojo-inject-api": 1,
"dojo-loader": 1,
"dojo-log-api": 0,
"dojo-modulePaths": 0,
"dojo-moduleUrl": 0,
"dojo-publish-privates": 0,
"dojo-requirejs-api": 0,
"dojo-sniff": 1,
"dojo-sync-loader": 0,
"dojo-test-sniff": 0,
"dojo-timeout-api": 0,
"dojo-trace-api": 0,
"dojo-undef-api": 0,
"dojo-v1x-i18n-Api": 1,
"dojo-xhr-factory": 0,
dom: 1,
"host-browser": 1,
"extend-dojo": 1
},
resourceTags: {
amd: function(o) {
return /\.js$/.test(o)
},
miniExclude: function(o, e) {
return e in {
"aaa/test.profile": 1,
"aaa/dojoConfig": 1
}
},
copyOnly: function(o, e) {
return e in {
"test/dojoConfig": 1
}
}
},
packages: [{
name: "dojo",
location: "dojo"
}, {
name: "test",
location: "test"
}],
layers: {
"dojo/dojo": {
include: ["dojo/dojo"],
customBase: !0,
boot: !0
},
"aaa/aaa-shared": {
include: ["test/shared/bootstrapShared"],
customBase: !0,
boot: !1
},
"aaa/aaa-content": {
include: ["test/content/bootstrap"],
customBase: !0,
boot: !1
},
"aaa/aaa-builder": {
include: ["test/builder/bootstrapBuilder"],
customBase: !0,
boot: !1
}
}
}
}();
回答1:
I'm not exactly sure if this is your problem, but miniExclude
takes precedence over copyOnly
, so marking something as both means that it won't be included in build output by default (since mini: true
is the default and you usually don't want to change that). If you always want a file to be copied and not otherwise processed, just include it in copyOnly
, not miniExclude
.
来源:https://stackoverflow.com/questions/28584758/dojo-build-copyonly-does-not-work-in-profile