-
Notifications
You must be signed in to change notification settings - Fork 33
Async/await is not working with this pattern #68
Comments
@rf00 AFAIK, systemjs classifies a module as an ES6 module only if there are import/export statements. Otherwise it assumes it is ES5 and does not apply the transpiler. |
@OrKoN It works! |
Sort of. Basically, if there is no out-of-band1 metadata specifying the format of a package, files are parsed and a format is inferred based on a number of factors including the presence of It is often desirable to specify the source module format declaratively as this may improve performance and does not depend on heuristics2 1 Out of band in this context would be package configuration such as SystemJS.config({
transpiler: "plugin-babel",
packages: {
"app" : {
// The format of modules within this package will not be inferred by parsing
// and rather will be assumed to match the specified value
"format": "esm",
"meta": {
"*.js" : {
"loader": "plugin-babel"
}
}
},
// the following are just examples for expository purposes
"jquery": {
"format": "amd"
},
"moment": {
"format": "cjs"
},
"rxjs": {
"format": "esm",
// I am a masochist who wants to build RxJS from source
"map": {
".": "./src"
},
"defaultExtension": "ts",
"meta": {
"*.ts": {
"loader": "plugin-typescript"
}
}
}
}
}); It may also come in the form of overrides in the jspm registry {
"format": "amd"
} or overrides explicitly provided when installing with jspm on a case by case basis $ jspm install jquery --override "{format : 'cjs'}" 2 See the SystemJS documentation for module-format-detection. |
This one works:
This one works with webpack but systemjs:
Not sure is it an issue
Edit:
Works after adding this:
export var p = 5;
More precisely, in configuration:
The text was updated successfully, but these errors were encountered: