I stumbled across a project I thought was interesting.
https://codesandbox.io/s/bar-chart-race-eop0s?file=/src/index.js
I downloaded the files.
I need the dependencies to be included as I see from the json package file:
{
"name": "bar-chart-race-starter",
"version": "1.0.0",
"description": "",
"main": "index.html",
"scripts": {
"start": "parcel index.html --open",
"build": "parcel build index.html"
},
"dependencies": {
"@types/d3": "5.7.2",
"d3": "5.15.0"
},
"devDependencies": {
"@babel/core": "7.2.0",
"parcel-bundler": "^1.6.1"
},
"keywords": []
}
I fetched the dependencies.
<script src="https://d3js.org/d3-axis.v1.min.js"></script>
<script src="https://d3js.org/d3.v5.min.js"></script>
I stuck them into index.html
I saved index.html
I try to run it through a browser:
Uncaught SyntaxError: import declarations may only appear at top level of a module
The src folder has an index.js
webconsole complains at this line: import "./styles.css";
even if I workaround and include the styles.css into html page through
<link rel = "stylesheet" type = "text/css" href = "./src >/Styles.css" />
it then cries about
import { generateDataSets } from "./dataGenerator";
which is line 2 of index.js
I am doing something wrong in implementing a local version of this project.
Can someone point out where I am going wrong?
It has to be much easier than this.
Help Please to download local version including dependencies of an codesandbox.io project.