I want to build a SPA with javascript knockout components After lots of reading and fiddling I still can't seem to get a working javascript(no typescript) knockout( with components) project with webpack. I found simple knockout projects but can't get them working with webpack.
Does someone have a demo project wit at least one ko component using webpack?
The Yeoman generator-ko-spa (in javascript) working with Webpack would be great.
Thnx
Here's how to set up a "Hello world" app from scratch:
Installing packages
npm init -y
npm install --save-dev webpack webpack-cli html-loader
npm install --save-dev knockout
"scripts": { "build": "webpack" }
Configuring webpack
webpack.config.js
file:Creating our component viewmodel & view
Components
Greeter.html
Greeter.js
Creating our entry points
index.html
index.js
fileBuild & browser
npm run build
, webpack will create a file in adist
folderindex.html
in your browser. It should greet you with a "Hello world"!