{"id":37,"date":"2018-09-10T23:08:29","date_gmt":"2018-09-10T23:08:29","guid":{"rendered":"https:\/\/kweaver.org\/cs\/mws-webpack-creating-a-new-mobile-website\/"},"modified":"2018-09-10T23:08:29","modified_gmt":"2018-09-10T23:08:29","slug":"mws-webpack-creating-a-new-mobile-website","status":"publish","type":"post","link":"https:\/\/kweaver.org\/cs\/mws-webpack-creating-a-new-mobile-website\/","title":{"rendered":"MWS &#8211; Webpack &#8212; Creating a new Mobile website"},"content":{"rendered":"<p>The MWS program was interesting and probably typical of what we would be asked to do in a job &#8212; take a very mobile unfriendly website and make it mobile \/ offline first.<\/p>\n<p>I&#39;m going to build a &quot;new&quot; website, using the techniques we learned. &#0160;It won&#39;t be completely new as I will be using old data.<\/p>\n<p>They didn&#39;t mention optimizing websites and using tools like babble, to make them more mobile friendly. &#0160;Webpack is the latest tool to accomplish that, and I&#39;m going to start with web pack first.<\/p>\n<p>The resources I&#39;ve been looking at include:<\/p>\n<p><a href=\"https:\/\/webpack.js.org\">The official Docs<\/a><\/p>\n<p><a href=\"https:\/\/www.learnhowtoprogram.com\/javascript\/test-driven-development\/webpack-and-npm-practice\">Step by Step instructions for newbie<\/a>&#0160;- this is what I am using below.<\/p>\n<p><a href=\"https:\/\/github.com\/kathweaver\/AmBRN-Mobile\">Not really about Webpack but good stuff for later.<\/a><\/p>\n<p>I&#39;ve created a Github repository at&#0160;https:\/\/github.com\/kathweaver\/AmBRN-Mobile. Feel free to join the fun.<\/p>\n<p>The first thing to do is set up .gitgnore file so it will ignore node, Mac stuff, and Visual Studio stuff. &#0160;That&#39;s in my master branch&#0160;<\/p>\n<p>Now I am switching to a branch called setup-webpack&#0160;<\/p>\n<p>The next thing is to initialize npm, which adds a package.json file<\/p>\n<p>Then we install Webpack and the Webpack cli. &#0160;Note that you need to add &#8211;save-dev so that the dependency will be added to the package.json file.<\/p>\n<p>Next I configured Webpack. &#0160;Added a script in package.json and a configuration file.<\/p>\n<p>Finally I&#39;m going to add some HTML from my old site and put it in the src directory. &#0160;Since I don&#39;t have any javascript code yet, I created an empty main.js.&#0160;<\/p>\n<p>The build worked. &#0160;In theory now, anyone can download my repo and it will build in Webpack. &#0160;I&#39;m committing this branch and working on the next part later.<\/p>\n<p>&#0160;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The MWS program was interesting and probably typical of what we would be asked to do in a job &#8212; take a very mobile unfriendly website and make it mobile \/ offline first. I&#39;m going to build a &quot;new&quot; website, using the techniques we learned. &#0160;It won&#39;t be completely new as I will be using [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-37","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/posts\/37","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":0,"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"wp:attachment":[{"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kweaver.org\/cs\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}