Build a basic Vue project without using Webpack. Here's a tutorial on developerlife.com that provides a detailed explanation of the code in this repo.
To enhance security, ES6 modules are subject to
same-origin policy
which means we have to run a local server in order to being able to run
JavaScript applications using this technology. Unfortunately, that means we
have to install a npm dependency browsersync
. There's more
info on stackoverflow
on this CORS (cross origin resource sharing) policy.
This is the folder and file structure of the project.
+-- package.json
+-- src
+-- TodoComponents.js
+-- index.html
+-- main.js
+-- styles.css
And here's the package.json
script that's needed to launch the local web
server that will serve up all the JS files from the same origin.
{
"scripts": {
"start": "browser-sync start --server 'src' --files 'src' --single"
}
}
Type the following commands:
npm install
npm start