MWS - Webpack -- Creating a new Mobile website
September 10, 2018
The MWS program was interesting and probably typical of what we would be asked to do in a job -- take a very mobile unfriendly website and make it mobile / offline first.
I'm going to build a "new" website, using the techniques we learned. It won't be completely new as I will be using old data.
They didn't mention optimizing websites and using tools like babble, to make them more mobile friendly. Webpack is the latest tool to accomplish that, and I'm going to start with web pack first.
The resources I've been looking at include:
Step by Step instructions for newbie - this is what I am using below.
Not really about Webpack but good stuff for later.
I've created a Github repository at https://github.com/kathweaver/AmBRN-Mobile. Feel free to join the fun.
The first thing to do is set up .gitgnore file so it will ignore node, Mac stuff, and Visual Studio stuff. That's in my master branch
Now I am switching to a branch called setup-webpack
The next thing is to initialize npm, which adds a package.json file
Then we install Webpack and the Webpack cli. Note that you need to add --save-dev so that the dependency will be added to the package.json file.
Next I configured Webpack. Added a script in package.json and a configuration file.
Finally I'm going to add some HTML from my old site and put it in the src directory. Since I don't have any javascript code yet, I created an empty main.js.
The build worked. In theory now, anyone can download my repo and it will build in Webpack. I'm committing this branch and working on the next part later.