Skip to content

Instantly share code, notes, and snippets.

@mdiener21
Last active October 28, 2017 07:34
Show Gist options
  • Save mdiener21/01f34511160ab54694cd05dca5748d23 to your computer and use it in GitHub Desktop.
Save mdiener21/01f34511160ab54694cd05dca5748d23 to your computer and use it in GitHub Desktop.
setup openlayers and webpack for development
{
"name": "newprojectname",
"version": "1.0.0",
"description": "test-map",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack --progress -p",
"watch": "webpack --progress --watch",
"server": "webpack-dev-server --open"
},
"author": "",
"license": "ISC",
"dependencies": {
"ol": "^4.4.2"
},
"devDependencies": {
"webpack": "^3.8.1",
"webpack-dev-server": "^2.9.3"
}
}
# note package.json must first be created
mkdir newprojectname
cd newprojectname
npm init
npm install ol --save
npm install webpack --save-dev
npm install webpack-dev-server --save-dev
# usage
# npm run build
# npm run watch
# npm run server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment