Today I learned “Serve” is a quick and useful webserver.
With Serve, quickly list a projects contents and browse subfolders
Install it globally (-g)
sudo npm install serve -g
serve
Or run it anywhere by giving the path serve <path>
http://localhost:5000
npm run build
NPM needs to be pre-installed on the system.
"build":
"scripts": {
"build": "webpack && serve",
"watch": "webpack --w"
},
"react"
package to the presets in webpack.config.js and .babelrc
{
"presets": ["env", "stage-0", "react"]
}
In webpack.config.js
use: {
loader: "babel-loader",
options: {
presets: ["env", "stage-0", "react"]
}
}
npm run build
http://localhost:5000