Answer the question
In order to leave comments, you need to log in
Is it possible to use .vue component files without node.js?
If you understand all the words from the subject, but the general meaning of the question is not clear, then I asked the question incorrectly.
But, here's what I wanted to know. I saw in different tutorials that you can use a file with the .vue extension that contains all the component code.
But, all tutorials show that the project is built using node.js
Isn't it possible to include components directly in the code?
Answer the question
In order to leave comments, you need to log in
Where directly in the code? In the browser?
Parsing .vue files is handled by vue-loader in Webpack. He knows that this file has tags <template>, <script>, <style>
, but the browser does not understand this, so special tools are needed to parse it.
I'm not sure if there is something for reading .vue at runtime, but it's better to use a proven practice - to collect the source code with a Babel bundler (input - your modules of different formats, not only JS, output - js bundle)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question