<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Tsz San Sam, CHAN</title>
    <description>The latest articles on Forem by Tsz San Sam, CHAN (@samsan1212).</description>
    <link>https://forem.com/samsan1212</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F269878%2F3df5a134-2a15-4648-8766-add359451772.jpeg</url>
      <title>Forem: Tsz San Sam, CHAN</title>
      <link>https://forem.com/samsan1212</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/samsan1212"/>
    <language>en</language>
    <item>
      <title>Webpack Typescript Starter</title>
      <dc:creator>Tsz San Sam, CHAN</dc:creator>
      <pubDate>Tue, 12 Nov 2019 03:50:38 +0000</pubDate>
      <link>https://forem.com/samsan1212/webpack-typescript-starter-45fj</link>
      <guid>https://forem.com/samsan1212/webpack-typescript-starter-45fj</guid>
      <description>&lt;p&gt;Love &lt;strong&gt;Webpack&lt;/strong&gt;? Love &lt;strong&gt;Typescript&lt;/strong&gt;? Feel frustrated of starting a Webpack + Typescript project?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Webpack Typescript Starter comes to help&lt;/em&gt;&lt;/strong&gt; 💪💪💪&lt;/p&gt;

&lt;p&gt;(Link of repository is in the end of the article)&lt;/p&gt;

&lt;h2&gt;
  
  
  Philosophy
&lt;/h2&gt;

&lt;p&gt;Webpack Typescript Starter aims to ease the pain of setting Webpack + Typescript project.&lt;/p&gt;

&lt;p&gt;With this starter, you can easily set up a&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;NodeJS project&lt;/li&gt;
&lt;li&gt;Frontend project&lt;/li&gt;
&lt;li&gt;Small script migrating to an existing HTML template engine&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although Webpack Typescript Starter can be the starter of a frontend project,&lt;br&gt;
it &lt;strong&gt;does not compete&lt;/strong&gt; with those wonderful frontend starters, e.g.&lt;br&gt;
&lt;a href="https://create-react-app.dev/"&gt;Create React App&lt;/a&gt;,&lt;br&gt;
&lt;a href="https://www.gatsbyjs.org/"&gt;GatsbyJS&lt;/a&gt;,&lt;br&gt;
&lt;a href="https://cli.vuejs.org/"&gt;VueJS CLI&lt;/a&gt;,&lt;br&gt;
&lt;a href="https://angular.io/guide/setup-local"&gt;Angular&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Webpack Typescript Starter only provide an environment of Webpack + Typescript, and letting you guys do your magic in there 😉&lt;/p&gt;
&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Clone this project
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;   git clone https://github.com/samsan1212/webpack-typescript-starter.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;OR create a new repository from this template by navigating to this &lt;a href="https://github.com/samsan1212/webpack-typescript-starter/generate"&gt;link&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Under the project root directory, run&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;OR&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Bob's your uncle🎉🎉🎉 You can perform your magic inside &lt;strong&gt;src&lt;/strong&gt; folder&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Configurations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  HTML Template file
&lt;/h3&gt;

&lt;p&gt;In the directory &lt;strong&gt;webpack/plugins&lt;/strong&gt;, there is a template HTML file &lt;strong&gt;html-template.html&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The starter generates a HTML file &lt;strong&gt;bin/index.html&lt;/strong&gt; with the script tags of the bundled javascript files, using this template HTML in the compile time.&lt;/p&gt;

&lt;p&gt;If you need the HTML file containing only the script tags of the bundled javscript files, you can empty the content inside the template HTML. &lt;em&gt;(Especially for those who want to migrate custom Javascripts to existing HTML template engine)&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  noHTML
&lt;/h3&gt;

&lt;p&gt;In &lt;strong&gt;package.json&lt;/strong&gt;, there is a config &lt;strong&gt;noHTML&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you are writing NodeJS program, you probably won't need the generated HTML file.&lt;/p&gt;

&lt;p&gt;In this case, you can type &lt;strong&gt;yes&lt;/strong&gt; in the config &lt;strong&gt;noHTML&lt;/strong&gt;,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"config"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"noHTML"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"yes"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;then no HTML will be emitted during the compile time.&lt;/p&gt;

&lt;p&gt;Go check the &lt;a href="https://github.com/samsan1212/webpack-typescript-starter"&gt;repository&lt;/a&gt;, and please kindly give me some comments.&lt;/p&gt;

&lt;p&gt;Your comments will make this project better.&lt;br&gt;
Thanks a lot.&lt;/p&gt;

</description>
      <category>webpack</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
