In order to import a css file into a handlebars project in nodejs, there’s one small thing that’s required to be done before the file will be accessible from the template files.
First, you’ll need to include the
const path = require('path');
Second, you’ll need to create a new public folder in the project. Then create another folder,
css, inside that folder.
Third, you’ll need to make that public folder accessible by the project:
Finally within your main handlebars template, you can now import css files from this folder:
<link rel="stylesheet" href="/css/bootstrap.min.css">