I am trying to use webpack-serve(not dev-server) and I am a bit confused on how to actually run it.
I installed it, I have npm, webpack 4 and using VS Code with command line.
It seems to me I should just put "webpack-serve" and it should run but I just get
'webpack-serve' is not recognized as an internal or external command,
operable program or batch file.
Do I need to set some pathing or something along those lines?
Edit
I got it to "Build" by installing it globally.
I am now trying to get webpack-serve to function exactly like what I had when I was using webpack-serve but right now it is not(it does not open the browser, not sure how switch between dev mode and production mode and not sure how to get routing to work)
I have made an example here: https://github.com/chobo2/webpack-serve-example
It is NOT recommended to install
webpackor anywebpackrelated tools globally so I'd recommend you uninstall all of them globally (NPM and Yarn) first..I started a new project and created 3
webpackconfig files:webpack.common.jswebpack.dev.jswebpack.prod.jsIn our
package.json:The thing I learned about
webpack-serveis we have to define aserveobject in ourwebpackconfig:We will run our project by calling
package.jsonscripts only,e.g.
yarn run serveoryarn run buildThe full example is on Github