Assuming that npm
is installed:
- Run:
npm install
That should add a folder node_modules
containing all the dependencies of the project.
- If
webpack
is not already installed, run:
npm install --save-dev webpack
npm install --save-dev webpack-cli
- Install the typescript compiler and loader by running:
npm install --save-dev typescript ts-loader
- Then install these
webpack
plugins:
npm i -D copy-webpack-plugin
That will allow webpack to copy the index.html
file in the build.
npm install webpack-dev-server --save-dev
That will allow to run a local server while webpack updates the build automatically, when you modify a file.
- run the project:
npm run dev:server
Go in your internet browser at http://localhost:8080/
- Note that the webpack-dev-server does not write files on the disk. To export your build ready (and run it on another local server or a remote server). Run:
npm run build