Cyan Hall C H
Created by Last updated: 11/25/2020 👉  

1. next.config.js

    const path = require('path');

module.exports = {
  webpack (config) {
    // Module import alias
    config.resolve.alias['~'] = path.resolve(__dirname, `.`);
    return config;

import Layout from '~/components/layout'

2. Link with className

    <Link href="/">
  <a className="foo" target="_blank" rel="noopener noreferrer">
    Hello World

3. Render HTML

    <div dangerouslySetInnerHTML={{ __html: postData.contentHtml }} />

  • To use CSS Modules, import a CSS file named *.module.css from any component.
  • To use global CSS, import a CSS file in pages/_app.js.
  • getStaticProps and getStaticPaths runs only on the server-side.