jcunanan05 / express-es6-sample Goto Github PK
View Code? Open in Web Editor NEWnode, expressjs app that allows use of es6. made with an article
node, expressjs app that allows use of es6. made with an article
When running npm run watch
I get the following error.
import app from '../app';
^^^
SyntaxError: Unexpected identifier
// package.js
...
"scripts": {
"start": "npm run prod",
"server": "babel-node ./src/bin/www",
"server:prod": "node ./dist/bin/www",
"dev": "NODE_ENV=development npm-run-all server",
"clean": "rimraf dist",
"super-clean": "rimraf dist node_modules public",
"build": "babel ./src --out-dir dist",
"prod": "NODE_ENV=production npm-run-all clean build server:prod",
"watch": "nodemon",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"cookie-parser": "^1.4.4",
"debug": "^4.1.1",
"esm": "^3.2.25",
"express": "^4.17.1",
"morgan": "^1.9.1",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.0"
},
"devDependencies": {
"@babel/cli": "^7.6.4",
"@babel/core": "^7.6.4",
"@babel/node": "^7.6.3",
"@babel/preset-env": "^7.6.3",
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.7.0",
"nodemon": "^1.19.3"
}
...
After transpiling the code the bin/www file does not get created inside dist-server.
Hi there
Does this support async arrow functions too?
how can we debug the project, i am using vscode, debug not working
Hey, first of all, a really nice article. Thanks for sharing!
I'm trying to run 'yarn run prod', but I'm getting this error:
Error: Cannot find module './routes/index'
Do you have any idea where I may have committed the mistake?
Thank you
Whenever I am trying to transpile the server/ it's not creating any compiled ./dist-server/bin/www into my project. I guess thats why whenver I try to build or prod it throws an error of module not found of ~/dist-server/bin/www.
How am i supposed to rectify it??
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.