Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 1.21 KB

README.md

File metadata and controls

47 lines (36 loc) · 1.21 KB

Introduction

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.

Single origin policy

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.

Structure of the project

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"
  }
}

Run it

Type the following commands:

  • npm install
  • npm start