Oh, didn’t know it’s loader’s responsibility. Will give the spec a read (haven’t read it throughly) and post to the issue track if I can’t figure it out.
But just to make sure I will ask the right question, we should write something like `import value from “./package.json”;` in es2015, and then somehow tell the loader (the part I will explore) the file being imported solely contains a json string, so it can be directly imported? > On Feb 26, 2015, at 4:29 PM, caridy <[email protected]> wrote: > > Glen, better to ask this question on > https://github.com/whatwg/loader/issues/new > <https://github.com/whatwg/loader/issues/new>, we will be happy to provide > more details since this has nothing to do with ES2015 specifications. > > /caridy > >> On Feb 26, 2015, at 3:24 AM, Glen Huang <[email protected] >> <mailto:[email protected]>> wrote: >> >> In nodejs you can require a json file directly to get its value: `var value >> = require(“./package.json”)`. >> >> Is there an equivalent construct in es2015? Or developers have to turn it >> into a module before it can be imported? >> _______________________________________________ >> es-discuss mailing list >> [email protected] <mailto:[email protected]> >> https://mail.mozilla.org/listinfo/es-discuss >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

