---
title: "Discussion on \"Setting up a Next.js Application with TypeScript, JIT Tailwind CSS and Jest/react-testing-library\" | Hashnode"
description: "Discussion on \"Setting up a Next.js Application with TypeScript, JIT Tailwind CSS and Jest/react-testing-library\". How I finally put together my ultimate web dev template after weeks of pain and Googling"
url: "https://hashnode.com/posts/setting-up-a-nextjs-application-with-typescript-jit-tailwind-css-and-jestreact-testing-library/610c96e2b79d6a113667e8bb"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Setting up a Next.js Application with TypeScript, JIT Tailwind CSS and Jest/react-testing-library](https://blog.antoniolofiego.com/setting-up-a-nextjs-application-with-typescript-jit-tailwind-css-and-jestreact-testing-library?utm_source=hashnode&utm_medium=feed)

How I finally put together my ultimate web dev template after weeks of pain and Googling

Aug 6, 2021 · 9 min read · blog.antoniolofiego.com  
Read the article

-   [#nextjs](https://hashnode.com/tag/nextjs)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#tailwind-css](https://hashnode.com/tag/tailwind-css)
-   [#jest](https://hashnode.com/tag/jest)
-   [#reactjs](https://hashnode.com/tag/reactjs)

## Written by

[Antonio Lo Fiego (He/Him)](https://hashnode.com/@antoniolofiego)

@antoniolofiego · New York City, NY

  
[View profile](https://hashnode.com/@antoniolofiego)

Cloud, Software and Data Professional - AWS Community Builder

I am a cloud-first software engineer and data professional, originally from Italy, but I moved to the US in 2016. With my blog, I want to provide digestible overviews of complex topics related to cloud computing, data engineering, and software development, as well as document my journey into tech as an immigrant without a formal CS background. I enjoy working on Open-Source projects and building communities centered on making tech accessible to everyone. I love playing Tetris with my fiancee, I am a slightly above average movie buff, and I like to think about myself as a home chef.

## Responses 5

Markdown supported · ⌘↵ to post

[Hans](https://hashnode.com/@hanspoo)

[Mar 26, 2022](https://hashnode.com/posts/setting-up-a-nextjs-application-with-typescript-jit-tailwind-css-and-jestreact-testing-library/610c96e2b79d6a113667e8bb/comment/623f1594da7e98a4a23878a5)

Thank you Antonio, a very good document, i've been using antd but you motivated me to take a look to tailwind.

[Jorge Zozaya](https://hashnode.com/@yozozaya)

[Sep 10, 2021](https://hashnode.com/posts/setting-up-a-nextjs-application-with-typescript-jit-tailwind-css-and-jestreact-testing-library/610c96e2b79d6a113667e8bb/comment/613bd08e1821961e2551d788)

Useful and practical guide. I just learnt how to use path aliases \*)

[John B](https://hashnode.com/@wbjohn)

[Aug 15, 2021](https://hashnode.com/posts/setting-up-a-nextjs-application-with-typescript-jit-tailwind-css-and-jestreact-testing-library/610c96e2b79d6a113667e8bb/comment/6118c988ac5c985f36434ba2)

Thanks, this was very helpful! The only additional thing I had to do was to add a fileMock.js to stub static assets, containing the following line:

```
module.exports = "/test-file-stub";
```

And updating the jest config:

```
  moduleNameMapper: {
    "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
      "<rootDir>/__mocks__/fileMock.js",
    "\\.(css|less|scss|sass)$": "<rootDir>/__mocks__/styleMock.js",
    "^pages/(.*)$": "<rootDir>/pages/$1",
    "^components/(.*)$": "<rootDir>/components/$1",
    "^modules/(.*)$": "<rootDir>/modules/$1",
  },
```

[Antonio Lo Fiego (He/Him)](https://hashnode.com/@antoniolofiego)

[Sep 2, 2021](https://hashnode.com/posts/setting-up-a-nextjs-application-with-typescript-jit-tailwind-css-and-jestreact-testing-library/610c96e2b79d6a113667e8bb/comment/6118c988ac5c985f36434ba2#reply-61311f0477de087890b8e290)

That's a good call! If you'd like to add it to the repo via a PR as well it would be wonderful!

[James Q Quick](https://hashnode.com/@jamesqquick)

[Aug 8, 2021](https://hashnode.com/posts/setting-up-a-nextjs-application-with-typescript-jit-tailwind-css-and-jestreact-testing-library/610c96e2b79d6a113667e8bb/comment/610f2a88528eff11aea8a735)

Great overview. Thanks!

[Sandeep Panda](https://hashnode.com/@sandeep)

[Aug 6, 2021](https://hashnode.com/posts/setting-up-a-nextjs-application-with-typescript-jit-tailwind-css-and-jestreact-testing-library/610c96e2b79d6a113667e8bb/comment/610d2278528eff11aea8787a)

Very interesting article. Next.js is awesome. :)

Btw, use \`\`\`js in your code blocks for the syntax highlighting to work.

[Antonio Lo Fiego (He/Him)](https://hashnode.com/@antoniolofiego)

[Aug 6, 2021](https://hashnode.com/posts/setting-up-a-nextjs-application-with-typescript-jit-tailwind-css-and-jestreact-testing-library/610c96e2b79d6a113667e8bb/comment/610d2278528eff11aea8787a#reply-610d38e9528eff11aea87bac)

Good call, I was using \`\`\`{js} for some reason!
