Vue 3 example app without compile and build step when you cannot use node or npm to build Vue SPA for whatever reason.
Some restrictions apply:
- Cannot use
webpackto minify bundle and tree shake (higher download size and less performant) - Cannot use
babelto transpileTypeScriptnot supported- CSS preprocessors like
Sassnot supported - Browsers without
ES6 Modulesnot supported
- Cannot use
.vuefiles (Single Vue Components)- Use of on-the-fly
templateruntime compilation is slower than Single Vue Components - Cannot use
Component-scoped CSS - Uglier and harder to mantain
- Use of on-the-fly
- If component modules are not preloaded in
index.htmlthen they will be loaded in waterfall (synchronous and time expensive), also easy to forget and hard to scale - Other functionality that requires a
npmbuild ornodedependencies not available via CDN
Start a development server to serve project files to localhost:3000.
npm run serveThis avoids CORS errors because index.html cannot be opened via file:// protocol, http(s):// is needed.
Development dependency browser-sync will be installed. This is the only depedency using npm and it is only for local development, not production.
Install pushqrdx.inline-html extension for syntax highlighting with render html and template /*html*/ tags.
Just add src folder to your production server.
No node, npm nor npm run build required.