linking of mvl external file
Closed this issue · 8 comments
it seems that doesn't support external file with in-browser development because i received an error if I linked it. please kindly fix that. thanks
Can you provide a reproduction or more information?
i want the view argument(of new Moon) should be separated as external file instead of swimming in html file.
my suppose file structure is:
-index.html // view
-view.mvl // view
-index.js // model / viewmodel
I tried to separate them in that fashion but I received when I did that.
Separate file views aren't supported. You can write code in your CSS/JS files and use import
if you want to separate them into different files. The view must always be in a .mvl
file, not HTML like in your example.
can you sight an example?
<h1>{name}</h1>
<script>
export { default } from './component';
</script>
its not working if I used moon cdn(in-browser dev only).
MVL files aren't supported with in-browser development, as it requires a separate compiler to create code for the browser. You'll have to use Moon CLI to use MVL, or will have to use other supported in-browser methods for importing files.
Closing because mvl is only supported in a Node environment through Moon CLI.