Configuration
In this module we'll have you configure a few things in Visual Studio Code so that you can optimize your build experience.
Open HTML files with Chrome
We're going to install a package just for opening raw HTML.
Go to the extensions on the left side of VS Code.
Search for
open-in-browser
. The package looks like this:Install the package.
Go into
00-setup.html
in VS Code.Add the following snippet:
Save your file by pressing
ctrl + s
*On a Windows machine, click on the
.html
file and pressctrl + alt + o
.On a Mac
cmd + alt + o
.You should be given a list of browsers. Choose Chrome.
You should see some text in a browser window:
Node Exec
We'll add a package called node exec
to VS Code. It's a free extension that allows us to run JavaScript in a console inside of VS Code. Follow these steps to get it:
Click on the extensions box in the sidepane to the left. It's the bottom one that looks like a box inside of a box.
Type Node Exec in the search bar.
Click on the
Node Exec
. It should be the top one.Click install.
Once we set up some files, we'll test our new extension.
Go into the
00-setup.js
file. See below for orientation:
Testing the set up
Still inside of
00-setup.js
, type in the following:
Open your terminal window by pressing
ctrl + `
. For clarity, we're pressingctrl
and then the back tick key, which is on the top of the "tilde" key. This key is located above thetab
key. Do not confuse this with an apostrophe'
.On a Windows machine press
fn + F8
, for Mac pressFunction + F8
.You should see the following message in your OUTPUT window:
Helpful Tip
Just a note on saving: VS Code has given us an easy to use tool for identifying unsaved files. The X which normally closes a tab will change to a solid circle or "bubble". It is very important that you adopt the habit of saving files before attempting to execute them.
Last updated