Replies: 7 comments 4 replies
-
Usage with NX. // eslint-disable-next-line @typescript-eslint/no-var-requires
const withNx = require('@nrwl/next/plugins/with-nx');
const withTranspileModules = require('next-transpile-modules');
const withPlugins = require('next-compose-plugins');
/**
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
**/
const nextConfig = {
nx: {
// Set this to true if you would like to to use SVGR
// See: https://github.com/gregberge/svgr
svgr: false,
},
};
module.exports = withPlugins([
withNx(nextConfig),
withTranspileModules(['@cloudscape-design/components']),
]); |
Beta Was this translation helpful? Give feedback.
-
Thank you everyone for the suggestions. We will add a reference to this issue to the Integration page to contain integration advice in one place. |
Beta Was this translation helpful? Give feedback.
-
The
I also get several errors when first launching the dev server that look like this:
This may be a fundamental disconnect between how Next.js wants to work, and how CloudScape Design currently works ... and that's fine! If they're not yet compatible, I can wait. But if it's just something I'm doing wrong, I'd be happy to hear it. This is a brand new Next install with very little configuration work done. My entire const withTranspileModules = require('next-transpile-modules');
const withPlugins = require('next-compose-plugins');
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
};
module.exports = withPlugins([withTranspileModules(['@cloudscape-design/components'])], nextConfig); |
Beta Was this translation helpful? Give feedback.
-
Instructions were added to our getting started article (at the very bottom of the page): https://cloudscape.design/get-started/integration/using-cloudscape-components/#bundling-assets |
Beta Was this translation helpful? Give feedback.
-
Built-in module transpilation: (https://nextjs.org/blog/next-13-1#built-in-module-transpilation-stable) You can now mark dependencies from local packages (like monorepos) or from external dependencies (node_modules) to be transpiled and bundled. This built-in support replaces the popular next-transpile-modules package. |
Beta Was this translation helpful? Give feedback.
-
We have now updated the Cloudscape website with instructions on how to use the new Next.js feature to transpile dependencies like Cloudscape. You can find them in the article Using Cloudscape components. |
Beta Was this translation helpful? Give feedback.
-
Description
For https://cloudscape.design/get-started/integration/using-cloudscape-components/
There should be instructions for nextJS installation to address this issue:
Along with installing cloudscape library you need to do the following if using NextJS:
npm install next-transpile-modules
next.config.js
fileconst withTranspileModules = require('next-transpile-modules');
withPlugins
declaration at the bottom:[withTranspileModules(['@cloudscape-design/components'])],
Alternatively you can address this: https://nextjs.org/docs/messages/css-npm
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions