-
-
Notifications
You must be signed in to change notification settings - Fork 49
exports.{MethodName} = function... not working #820
Comments
Indeed when using the attached project and trying it with /***/ "./inner-non-working/inner-page.ts":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _inner_view_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./inner-non-working/inner-view-model.ts");
exports.onLoaded = function (args) {
console.log('Inner non-working loaded');
var page = args.object;
page.bindingContext = new _inner_view_model__WEBPACK_IMPORTED_MODULE_0__["InnerViewModel"]();
};
;
if (false) {}
/***/ }), When /***/ "./inner-non-working/inner-page.ts":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var inner_view_model_1 = __webpack_require__("./inner-non-working/inner-view-model.ts");
exports.onLoaded = function (args) {
console.log('Inner non-working loaded');
var page = args.object;
page.bindingContext = new inner_view_model_1.InnerViewModel();
};
;
if (false) {}
/***/ }), In the first case webpack uses Basically, there are two problems here:
As a workaround for both issues, you can set Useful resources: |
Environment
Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):Describe the bug
Method exports like this:
are not working when you use
--bundle
. The same works without the--bundle
flag. If you export the method using the following syntax it works:To Reproduce
Export a method using the first approach and start the app with
--bundle
.Expected behavior
Both export syntaxes should work.
Sample project
You can check this project webpack-issue.zip. There are two inner pages, one of them working, one not. The only difference is in the way the
onLoaded
method is exported.Additional context
The issue was introduced in official version 0.18.5, it works in 0.18.3
The text was updated successfully, but these errors were encountered: