Skip to content

Commit

Permalink
add rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswhong committed Nov 28, 2022
1 parent 6b13ddb commit d62731f
Show file tree
Hide file tree
Showing 63 changed files with 7,316 additions and 173,422 deletions.
53 changes: 25 additions & 28 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
{
"extends": [
"@mapbox/eslint-config-mapbox/base",
"prettier"
],
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": "error",
"strict": 0
},
"env": {
"es6": true,
"node": true,
"browser": true
},
"globals": {
"mapboxgl": true,
"MapboxGeocoder": true,
"MapboxDraw": true,
"turf": true,
"CodeMirror": true,
"Base64": true,
"d3": true
},
"parserOptions": {
"ecmaVersion": 9
}
"extends": [
"@mapbox/eslint-config-mapbox/base",
"prettier"
],
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": "error",
"strict": 0
},
"env": {
"es6": true,
"node": true,
"browser": true
},
"globals": {
"Base64": true,
"d3": true
},
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"allowImportExportEverywhere": true
}
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/node_modules
.DS_Store
.DS_Store
/dist
17 changes: 1 addition & 16 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
{
"emeraldwalk.runonsave": {
"commands": [
{
"match": "lib|src|css/tailwind_src.css",
"cmd": "make"
}
]
},
"liveServer.settings.ignoreFiles": [
"lib/*",
"src/*",
"css/tailwind_src.css"
],
"liveServer.settings.wait": 500,
"search.exclude": {
"**/dist": true,
},
"liveServer.settings.port": 5501,
}
}
76 changes: 0 additions & 76 deletions Makefile

This file was deleted.

20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,19 @@ Full API documentation can be found in [API.md](API.md).

## Development

Install [browserify](https://github.com/substack/node-browserify)'ied libraries:
1. Clone this repository
2. Install dependencies
3. Run `npm start`

`npm install`
`npm start` uses `concurrently` to run `live-server` which will serve the project directory in your browser and listen for changes, `rollup` which will build the js and css bundles, and `npx tailwindcss` which builds `css/tailwind_dist.css` (including only the tailwind rules needed in the project)

Browserify libraries, concat other libraries, build minimal d3, build tailwind css:
`rollup` can take several seconds to build before changes appear in the browser.

`make`
## Production Build & Deployment

Run a local server to preview your changes.
`npm run build` will create minified bundles in `/dist`. You can try out the production build with `npm run serve` which will run live-server.

### Development with VSCode (hot reloading)

An optimized development workflow is possible with the `Live Server` and `Run on Save` VS Code extensions. Both have workspace-specific settings in `settings.json`:

- Start a live server using `Live Server's` "Go Live" button
- `Run on Save` will watch `/lib`,`/src`, and `css/tailwind_src.css` and run `make` when any of them change.
- `Live Server` will ignore `/lib`,`/src`, and `css/tailwind_src.css`, but will hot reload whenever any other file changes (including the files created by `make`)
To deploy to github pages, use `npm run deploy`. This will run the deploy script in `deploy.sh`, which creates a new orphan branch from the current branch, runs a production build, and force pushes to the `gh-pages` branch.

## License

Expand Down
Loading

0 comments on commit d62731f

Please sign in to comment.