Webpack & TypeScript Setup #2 - Webpack Installation
Key Takeaways
Installs Webpack for TypeScript
Full Transcript
alright then gang so I've already opened up vs code and I've got a brand new project a folder called web pack typescript nothing in there at the minute and the first thing I'm gonna do is create or initialize a new typescript project now to do that we say TS c and we need typescript installed globally on our computer in order to do this remember if you don't know how to do that check out the tutorial series all about typescript the link is down below and then double dash and in it and this initialize Azores with a typescript config file right here so inside this config file we can specify different options about how typescript is gonna work the only two things I'm gonna do is change the target property to es6 and that means that the output javascript that we're going to get at the end is going to follow along with the es6 specification and i want to say that the module system that we're going to use is going to be the es 2015 specification as well so that's all I'm going to do inside that config file the next thing I want to do is initialize a package.json file to keep track of all of our dependencies because we need to install a few dependencies for webpack so to do that I'm going to say NPM in it and then press ENTER and then down here I'm just going to enter through all of the different questions it's asking me right here the entry point will be indexed is enter through the rest that's absolutely fine you can fill these in if you wish but for me that's absolutely fine and now we get this package JSON file and whenever we're using NPM to install different packages we typically create this package JSON file first of all to keep track of those dependencies that we install so speaking of dependencies we want to install web pack as a dependency to this project and also a couple of other things as well so to do that we'll say NPM install and it's going to be web pack first of all we also want to install the web pack CLI and that's going to be how we interact with web pack via the command line interface then we want to also install TS loader and that is going to be something that we use later on as well so we want to save all of these to our dev dependencies so that the tracked inside package and to do that we can say - capital D and that saves them to the dev dependencies so webpack that package is going to be the core webpack package that ultimately compiles and bundles all of our code together the web pack CLI is going to be a tool that allows us to run web pack commands from the command line and the TS loader is a package that teaches web pack how to compile typescript into javascript and without it it wouldn't be able to do that so now we can see that we have a node modules folder and a package lock file right there as well now all of the dependencies we just installed are going to live inside this node modules folder we don't need to go in there and edit anything directly that's just where they live now this package lock file just locks in our dependencies for us we don't need to go into that file and do anything with that either but if we go into the package JSON file we can see now we have this property called dev dependencies and that is listing these three packages we just installed right here now you should also install typescript locally for your project as a dev dependency - for web pack to work with it properly even though we have it installed globally on our computer so to do that I'm going to say npm install typescript and then i'm going to add that as a dev dependency - press ENTER to install that local it for this project as a dev dependency so there we go that's that installed as well so this package JSON file is keeping track of all of the dependencies we use as well as store information about other things in our project as well such as the scripts and we'll come to that later on for now though we don't need to do anything more with it so now we've installed web pack and the other package is that we're going to need over the next couple of lessons now let's create a folder structure for our project so the first thing I'm going to do is create a new folder for the source files inside this project so all of our source code is going to live inside this folder right here the typescript files that I'm going to be creating so when I'm writing code for this project I'll only ever be writing code in files inside this source folder that is the source code now I also need to create another folder which is going to contain all of my final JavaScript any final CSS and HTML which will then be ready for deploying to the web so to do that I'm going to create another folder called public but you might also see this being called dist or something else but ultimately this folder will contain all of our final files and it will be the folder upload it to a web server to host the website now it should probably contain at least one HTML file since that is the backbone of a website so what I'm going to do is create a new file inside that called index dot HTML and inside here I'll say doc and tab and that creates me this mini boilerplate and what I'm actually going to do is just copy and paste all of the contents from my repo in here so you don't have to watch me write out HTML so let me paste that in dead-dead simple all this is is an h1 right here then a form with three labels and three inputs one for name one for email and one for age and we have a button at the bottom to submit it now I'm also going to change this title right here to webpack and type script like so and that is our HTML file done so that is pretty much it as far as the initial setup is concerned in fact I will just add one more file inside this source folder right here new file and we'll call this index dot es so remember es is the extension we use for typescript files and all of our typescript files are going to live inside this source folder right so the way this will work is as follows we're gonna write all of our code inside the source folder so anything typescript is going to go inside this source folder right here web pack is then later going to take those files and compile them into a single JavaScript bundle and it's then going to output that single bundle inside the public folder right here so we might have then something like bundled is inside this public folder and that is going to be then ready you deploy to the web and then the index file right here can later link to that bundle jeaious file so now I have the bare-bones set up in the next lesson we're going to create a web pack file to start this whole process
Original Description
🐱👤🐱👤 JOIN THE GANG -
https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg/join
----------------------------------------
🐱💻 🐱💻 My Udemy Courses:
+ Modern JavaScript - https://www.thenetninja.co.uk/udemy/modern-javascript
+ Vue JS & Firebase - http://www.thenetninja.co.uk/udemy/vue-and-firebase
+ D3.js & Firebase - https://www.thenetninja.co.uk/udemy/d3-and-firebase
🐱💻 🐱💻 Course Files:
https://github.com/iamshaunjp/webpack-and-typescript
🐱💻 🐱💻 Other Related Free Courses:
+ HTML & CSS Crash Course - https://www.youtube.com/playlist?list=PL4cUxeGkcC9ivBf_eKCPIAYXWzLlPAm6G
+ Modern JavaScript - https://www.youtube.com/playlist?list=PL4cUxeGkcC9haFPT7J25Q9GRB_ZkFrQAc
+ TypeScript Tutorial - https://www.youtube.com/playlist?list=PL4cUxeGkcC9gUgr39Q_yD6v-bSyMwKPUI
🐱💻 🐱💻 TypeScript Docs:
https://www.typescriptlang.org/docs/home.html
🐱💻 🐱💻 The Net Ninja Community Boards:
https://community.thenetninja.co.uk/
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Net Ninja · Net Ninja · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Net Ninja
Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Net Ninja
Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Net Ninja
GraphQL Tutorial #1 - Introduction to GraphQL
Net Ninja
GraphQL Tutorial #2 - A Birdseye View of GraphQL
Net Ninja
GraphQL Tutorial #3 - Project (stack) Overview
Net Ninja
GraphQL Tutorial #4 - Making Queries (front-end preview)
Net Ninja
GraphQL Tutorial #5 - Express App Setup
Net Ninja
GraphQL Tutorial #6 - Setting up GraphQL
Net Ninja
GraphQL Tutorial #7 - GraphQL Schema
Net Ninja
GraphQL Tutorial #8 - Root Query
Net Ninja
GraphQL Tutorial #9 - The Resolve Function
Net Ninja
GraphQL Tutorial #10 - Testing Queries in Graphiql
Net Ninja
GraphQL Tutorial #11 - GraphQL ID Type
Net Ninja
GraphQL Tutorial #12 - Author Type
Net Ninja
GraphQL Tutorial #13 - Type Relations
Net Ninja
GraphQL Tutorial #14 - GraphQL Lists
Net Ninja
GraphQL Tutorial #15 - More on Root Queries
Net Ninja
GraphQL Tutorial #16 - Connecting to mLab
Net Ninja
GraphQL Tutorial #17 - Mongoose Models
Net Ninja
GraphQL Tutorial #18 - Mutations
Net Ninja
GraphQL Tutorial #19 - More on Mutations
Net Ninja
GraphQL Tutorial #20 - Updating the Resolve Functions
Net Ninja
GraphQL Tutorial #21 - GraphQL NonNull
Net Ninja
GraphQL Tutorial #22 - Adding a Front-end
Net Ninja
GraphQL Tutorial #23 - Create React App
Net Ninja
GraphQL Tutorial #24 - Book List Component
Net Ninja
GraphQL Tutorial #25 - Apollo Client Setup
Net Ninja
GraphQL Tutorial #26 - Making Queries from React
Net Ninja
GraphQL Tutorial #27 - Rendering Data in a Component
Net Ninja
GraphQL Tutorial #28 - Add Book Component
Net Ninja
GraphQL Tutorial #29 - External Query File
Net Ninja
GraphQL Tutorial #30 - Updating Component State
Net Ninja
GraphQL Tutorial #31 - Composing Queries
Net Ninja
GraphQL Tutorial #32 - query variables
Net Ninja
GraphQL Tutorial #33 - Re-fetching Queries
Net Ninja
GraphQL Tutorial #34 - Book Details Component
Net Ninja
GraphQL Tutorial #36 - Styling the App
Net Ninja
GraphQL Tutorial #35 - Making a Single Query
Net Ninja
Build Apps with Vue & Firebase - Udemy Course
Net Ninja
Updated Vue & Firebase Course (Udemy)
Net Ninja
Vue & Firebase Real-time Chat (Preview) #1 - Intro
Net Ninja
Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Net Ninja
Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Net Ninja
Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Net Ninja
Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Net Ninja
Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Net Ninja
Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Net Ninja
Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Net Ninja
Object Oriented JavaScript Tutorial #1 - Introduction
Net Ninja
Object Oriented JavaScript Tutorial #2 - Object Literals
Net Ninja
Object Oriented JavaScript Tutorial #3 - Updating Properties
Net Ninja
Object Oriented JavaScript Tutorial #4 - Classes
Net Ninja
Object Oriented JavaScript Tutorial #5 - Class Constructors
Net Ninja
Object Oriented JavaScript Tutorial #6 - Class Methods
Net Ninja
Object Oriented JavaScript Tutorial #7 - Method Chaining
Net Ninja
Object Oriented JavaScript Tutorial #8 - Class Inheritance
Net Ninja
Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Net Ninja
Object Oriented JavaScript Tutorial #10 - Prototype
Net Ninja
Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Net Ninja
Related AI Lessons
⚡
⚡
⚡
⚡
Next.js vs Remix vs SvelteKit: Which Framework Should You Learn?
Dev.to · Etrit Neziri
Had my Frontend Developer interview with Capgemini (Application Developer) today, and I wanted to…
Medium · JavaScript
10 Frontend Developer Tools to Boost Productivity in 2026
Medium · Programming
10 Frontend Developer Tools to Boost Productivity in 2026
Medium · JavaScript
🎓
Tutor Explanation
DeepCamp AI