https://github.com/survi218/food-menu
Restaurant Menu Cart to checkout
https://github.com/survi218/food-menu
babel-preser-es2015 babel-preset babelify browserify browsersync bulma es6 heroku-deployment javascript lite-server node-sass watchlist
Last synced: 3 months ago
JSON representation
Restaurant Menu Cart to checkout
- Host: GitHub
- URL: https://github.com/survi218/food-menu
- Owner: survi218
- Created: 2017-06-19T19:31:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-18T16:39:35.000Z (over 2 years ago)
- Last Synced: 2025-03-16T07:16:21.004Z (7 months ago)
- Topics: babel-preser-es2015, babel-preset, babelify, browserify, browsersync, bulma, es6, heroku-deployment, javascript, lite-server, node-sass, watchlist
- Language: CSS
- Homepage:
- Size: 18.6 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Restaurant Menu
This is an interactive menu created for a fictional restaurant. This project was made entirely in vanilla JavaScript without the help of any libraries. [Browserify](https://github.com/substack/node-browserify#usage) and [Babel](https://github.com/babel/babel) were used to convert the ES6 to ES5 and then bundle all the modules together.
# In the Package.json file
````
"serve": "npm run build; npm run watch:js -- & > /dev/null 2>&1; npm run watch:scss -- & > /dev/null 2>&1; lite-server"
````
* Hey! I hope you're enjoying the project. When I made that, I didn't even think about the Windows users out there. It uses some syntax that available in Unix based systems. So, it doesn't work on Windows. :( We get better as we grow, right? :) Anyhoo...it is easy to fix. That script is essentially building the files and then running a bunch of watch scripts. This can be fixed using a package I use all the time now called concurrently. Here's how you can fix it.
* Add a script to the package.json called preserve and make it npm run build. Then use npm to install concurrently with
````
npm install --dev concurrently
````
Lastly, we edit the serve script to be
````
"serve":"concurrently \"npm run watch:js\" \"npm run watch:scss\" \"lite-server\""
````
- I still got the errors with the above code in watchify, so i modified to the below code.
* Perfect code for windows OS in the package.json
````
"scripts": {
"dev": "lite-server",
"preserve": "npm run build",
"build:js": "browserify src/js/index.js -d -t babelify -o build/bundle.js",
"watch:js": "watchify src/js/index.js -d -v -t babelify -o build/bundle.js",
"build:scss": "node-sass src/scss/styles.scss --output build --source-map-embed --source-map-contents",
"watch:scss": "npm run build:scss -- --watch",
"build": "npm run build:js && npm run build:scss",
"serve": "concurrently \"npm run watch:js --& > /dev/null 2>&1\" \"npm run watch:scss --& > /dev/null 2>&1\" \"lite-server\""
},
````