Sign in
Log inSign up
Antonio Lo Fiego (He/Him)

77 likes

·

7.8K reads

7 comments

James Q Quick
James Q Quick
Aug 8, 2021

Great overview. Thanks!

1
·
Jorge Zozaya
Jorge Zozaya
Sep 10, 2021

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

1
·
Sandeep Panda Test
Sandeep Panda Test
Aug 6, 2021

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

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

·
·1 reply
Antonio Lo Fiego (He/Him)
Antonio Lo Fiego (He/Him)
Author
·Aug 6, 2021

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

·
John B
John B
Aug 15, 2021

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",
  },
·
·1 reply
Antonio Lo Fiego (He/Him)
Antonio Lo Fiego (He/Him)
Author
·Sep 2, 2021

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

·
Hans
Hans
Mar 26, 2022

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

·