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

Feature request: transpile dependencies (with next-transpile-modules) #45

Open
fabien opened this issue Jun 14, 2021 · 0 comments
Open

Comments

@fabien
Copy link

fabien commented Jun 14, 2021

I'm using https://github.com/martpie/next-transpile-modules within a mono-repo for a smooth dev experience. Unfortunately, it is not compatible with next-plugin-preval.

In theory next-transpile-modules would run before next-plugin-preval and it should all just work, but this is not the case. I need them in reverse order to actually have a working app at all.

Would be awesome if it would work transparently.

const withPlugins = require('next-compose-plugins');
const transpileModules = require('next-transpile-modules');
const withTranslations = require('next-translate');

const withPreval = require('next-plugin-preval/config')();

const withBundleAnalyzer = require('@next/bundle-analyzer')({
  enabled: process.env.ANALYZE === 'true',
});

const coreModules = [];

const nextConfig = {};

const withTM = transpileModules(
  ['lodash-es', ...coreModules],
  {
    resolveSymlinks: true
  }
);

return withPlugins(
  [
    withPreval(), // first
    withTM, // second
    withTranslations,
    withBundleAnalyzer
  ],
  nextConfig
);
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

No branches or pull requests

1 participant