Pug (Jade) Template Engine
JetBrains Rider integrates with the Pug (Jade) template engine.
Before you start
- Install the Node.js runtime environment.
- Make sure the NodeJS and Pug (ex-Jade) plugins are installed and enabled. The plugins are not bundled with JetBrains Rider, but they can be installed from the JetBrains plugin repository as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins. Once enabled, the plugins are available at the IDE level, that is, you can use them in all your JetBrains Rider projects.
Also, if you need a file watcher, make sure that the File Watchers plugin is installed and enabled. The plugin is not bundled with JetBrains Rider, but it can be installed from the JetBrains plugin repository as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.
Changes to the UI
The Pug (ex-Jade) plugin introduces the following changes to the JetBrains Rider UI:
Using Pug(Jade) templates in a Node.js application
At runtime, the Pug (Jade) files fill be transformed into HTML pages.
- Create a project from scratch, or around existing sources, or based on a NodeExpress template.
- Create a Pug (Jade) file. Follow these steps:
- In the Solution window, select the directory in which you want to create a new file. To do that, for example, choose .
- On the context menu, choose Jade file and specify the file name in the dialog box that opens.
- Create a File Watcher to transform files with the extension
- Click the Add Watcher link in the upper right-hand corner of the editor.
- In the New Watcher Dialog, accept the default predefined settings.
Note that if the executable is in the PATH, then you should not specify it explicitly. Depending on the file extension (
.pug), the corresponding executable is invoked.
- As you edit a
.jadefile, JetBrains Rider invokes the file watcher which creates an
.htmlfile with the name of the processed
.jadefile and stores the generated
htmlcode in it.
See Using File Watchers for details.