Reputation: 55729
(Followup to this answer)
Please can someone confirm that the following syntax is still valid in ES6?
module "javascripts/bar" {
export function Bar() {}
}
I am thinking about the scenario where I use concatenation. Yes I know HTTP2 will make concatenation moot, but I would like to concatenate my modules today.
If this is not valid, how should I construct my modules so that they remain valid in the same file?
Upvotes: 2
Views: 142
Reputation: 276286
This is the old module syntax that was removed. The above is no longer valid since Rev28 of the ES6 draft. Do not use this syntax any more it is not valid ES6. (relevant esdiscuss with it being removed) (esdiscuss coming to the conclusion to remove it)
ES6 has a module-per-file module. If a file is imported using import
it will be treated as a module.
Update: I just noticed that Alex has written about it that is probably a good read on the subject. His links are wrong though.
Upvotes: 4