You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given that node require supports JSON, I think the current situation is still acceptable, but only if type: "json" is the only accepted in the proposal. That said, if the spec will allow other type values in the future, we should decide
Should we skip the import node with module attributes? Since we can offer a custom plugin to transform module attributes into bundler-specific annotations, e.g. import(/* webpackChunkName: "lodash" */ 'lodash')
Or should we still treat them as those without attributes? A warning message can be printed since it may not be natively supported on node.js, but users may intend to pass the transpiled sources through bundlers which may support them via file extensions.
I don't have preference between these two solutions, or maybe we should even pursuit for an option. Other solutions are definitely welcome.
The text was updated successfully, but these errors were encountered:
It doesn’t matter what other type values there are - the proposal already supports any string you want; it’s up to the engine to decide what it supports. In other words, until node itself makes a decision on what to support, there’s no right answer here. I think the current behavior makes the most sense - ie, ignoring attributes entirely.
Babel 7.10 is going to support parsing stage-1 module attributes
Currently this plugin will transform the code above to
where module attributes are excluded.
Given that node
require
supports JSON, I think the current situation is still acceptable, but only iftype: "json"
is the only accepted in the proposal. That said, if the spec will allow othertype
values in the future, we should decideShould we skip the import node with module attributes? Since we can offer a custom plugin to transform module attributes into bundler-specific annotations, e.g.
import(/* webpackChunkName: "lodash" */ 'lodash')
Or should we still treat them as those without attributes? A warning message can be printed since it may not be natively supported on node.js, but users may intend to pass the transpiled sources through bundlers which may support them via file extensions.
I don't have preference between these two solutions, or maybe we should even pursuit for an option. Other solutions are definitely welcome.
The text was updated successfully, but these errors were encountered: