weex-loader support both Weex and Vue now, it should also offer a way to distinguish the bundle type.
Currently, Weex is using a banner comment to distinguish the type of the bundle, and find the corresponding framework to create instance. It's neither elegant nor robust.
I think we should offer a function (e.g. getWeexBundleType) or a global variable (e.g. WEEX_BUNDLE_TYPE) to get the type of current bundle.
The current way has the best perf and simplicity. The type detection will be done before the JS bundle executed. No chance to run a function or get value for a global variable.
weex-loader
support both Weex and Vue now, it should also offer a way to distinguish the bundle type.Currently, Weex is using a banner comment to distinguish the type of the bundle, and find the corresponding framework to create instance. It's neither elegant nor robust.
I think we should offer a function (e.g.
getWeexBundleType
) or a global variable (e.g.WEEX_BUNDLE_TYPE
) to get the type of current bundle.