Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use nextjs experimental externalDir #265

Merged
merged 5 commits into from
Aug 13, 2021

Conversation

belgattitude
Copy link
Owner

@belgattitude belgattitude commented Aug 13, 2021

Purpose

Trying out recent externalDir offered by NextJs: vercel/next.js#22867. It works perfect even supporting svg and offer comparable speed.

Benchmarks

With experimental/externalDirs

**FIRST BUILD: 22 seconds **:
(mean ± σ): 9 seconds:

Selection_220

With previous implementation (webpack)

Example of next.config.js overrides
const nextConfig = {
  webpack: function (config, { defaultLoaders }) {
    // This extra config allows to use paths defined in tsconfig
    // @link https://github.com/vercel/next.js/pull/13542
    const resolvedBaseUrl = path.resolve(config.context, '../../');
    config.module.rules = [
      ...config.module.rules,
      {
        test: /\.(tsx|ts|js|jsx|json)$/,
        include: [resolvedBaseUrl],
        use: defaultLoaders.babel,
        exclude: (excludePath) => {
          return /node_modules/.test(excludePath);
        },
      },
    ];
    return config;
  },
};

**FIRST BUILD: 22 seconds **:
(mean ± σ): 9 seconds:

Selection_221

@changeset-bot
Copy link

changeset-bot bot commented Aug 13, 2021

🦋 Changeset detected

Latest commit: e321b8c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
blog-app Minor
web-app Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Aug 13, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

nextjs-monorepo-example-blog-app – ./apps/blog-app

🔍 Inspect: https://vercel.com/belgattitude/nextjs-monorepo-example-blog-app/35gv5tEMWW2ZxsEN2KD8JrhDUqK8
✅ Preview: https://nextjs-monorepo-example-blog-app-git-experi-c38d06-belgattitude.vercel.app

nextjs-monorepo-example-web-app – ./apps/web-app

🔍 Inspect: https://vercel.com/belgattitude/nextjs-monorepo-example-web-app/8ctNB46bupJfQxz5ZoWR8Dgt4zRo
✅ Preview: https://nextjs-monorepo-example-web-app-git-experim-931bbf-belgattitude.vercel.app

@codeclimate
Copy link

codeclimate bot commented Aug 13, 2021

Code Climate has analyzed commit e321b8c and detected 0 issues on this pull request.

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant