How to convert a .vue file to a .js file?

I want to convert all files written by others in .vue format into .js files. What tools should I use? It is not packaged using webpack.

Mar.14,2021

vue format in addition to js code, there are templates and css, how do you convert it? It would be OK to convert the template to a template attribute string in the component, like this:

export default {
  template: `<div></div>`,
  ...

if this transformation is acceptable, you can call vue's own template compiler to do the transformation, but what about css? I guess I'll just have to throw it away.


you can take a look at vue-loader principle

Menu