Skip to content

Commit e905317

Browse files
committed
Fix Promise build. Lie is now copied in the build output
1 parent 7948a6c commit e905317

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Promise.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
*/
2020
/* global Promise */
2121
define(["require"], function (require) {
22+
var writeFile;
23+
var lieId = "lie/dist/lie";
24+
2225
return {
2326
load: function (name, req, onload, config) {
2427
config = config || {};
@@ -30,11 +33,19 @@ define(["require"], function (require) {
3033
// Use absolute path to allow map configuration.
3134
// Also use a variable to avoid RequireJS detection at build time so it is not included in the
3235
// layer.
33-
var lieId = "lie/dist/lie";
3436
require([lieId], function (lie) {
3537
onload(lie);
3638
});
3739
}
40+
},
41+
writeFile: function (pluginName, resource, require, write) {
42+
writeFile = write;
43+
},
44+
onLayerEnd: function () {
45+
var fs = require("fs");
46+
var url = require.toUrl(lieId + ".js");
47+
// copy lie to the build output.
48+
writeFile(url, fs.readFileSync(url));
3849
}
3950
};
4051
});

0 commit comments

Comments
 (0)