vuejs/vue-component-compiler

ES6 module support

neemzy opened this issue · 2 comments

Hello!

Would you consider supporting compiling .vue SFCs to plain ES6 modules, instead of CommonJS?
That would allow one to use such components through <script type="module">.

Thanks!

Hey maintainers, we're getting requests from Snowpack users who would like to use SFC's in their application. This tool would need to compile components to ESM instead of Common.js, since only ESM can run natively in the browser.

context: http://snowpack.dev/ & FredKSchott/snowpack#174

How much work are we talking about to compile components as ESM instead of CJS? This would have benefits for both bundled applications as well: bundlers are even better at optimizing/tree-shaking ESM than CJS.

WIth your guidance I can try to donate some time to fixing, or someone from the Snowpack community might also be interested in helping as well.

Vue is one of the few web frameworks with a partial ESM story. This would go a long way to improving that.

znck commented

This is an outdated issue. The output JavaScript is an ES module (it has been like this for a while).