2
我試圖使用systemjs系統導出,我已經遠銷這個代碼與TSC: https://github.com/quantumjs/solar-popup/blob/master/package.json#L10如何飲用打字稿模塊:在瀏覽器systemjs
{
"compilerOptions": {
"module": "system",
"target": "es5",
"sourceMap": true,
"outFile":"./build/solar-popup.js",
"sourceRoot": "./src/SolarPopup.ts",
"rootDir": "./src/"
},
"exclude": [
"node_modules"
]
}
但是隨後試圖使用它在瀏覽器導入的對象不包含任何導出。我認爲,這是由於不包含任何出口太陽能popup.js,只是System.register調用
出口是這樣的:
System.register("SolarPopup", ["ModalBackground", "constants"], function (exports_4, context_4) {
"use strict";
var __moduleName = context_4 && context_4.id;
var ModalBackground_1, constants_2, SolarPopup;
return {
setters: [
function (ModalBackground_1_1) {
ModalBackground_1 = ModalBackground_1_1;
},
function (constants_2_1) {
constants_2 = constants_2_1;
等
感謝,我最後不得不做**常量contactFormPopup =新SolarPopup.SolarPopup(子)**似乎有點醜,我更喜歡只是使用的WebPack包.. – Nikos