-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add transpile packages to nextjs (#378)
- Loading branch information
1 parent
7db6757
commit 3b1a313
Showing
1 changed file
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,59 @@ | ||
<%_if (answers["ui-framework"] === "antd" && answers[`i18n-${answers["ui-framework"]}`] !== "no") {_%> | ||
<%# https://github.com/refinedev/refine/issues/5197 %> | ||
<%# We need to add @refinedev/nextjs-router to the next.config.js#transpilePackages to avoid ssr mismatches. %> | ||
|
||
<%# https://github.com/refinedev/refine/issues/4998 %> | ||
<%# Also if user selects ant design we need to add @refinedev/antd and if they selected example pages (inferencer is installed) we can add @refinedev/inferencer as well. %> | ||
|
||
<%_if (answers["ui-framework"] === "antd" && answers["inferencer"] === 'inferencer' && answers[`i18n-${answers["ui-framework"]}`] !== "no") {_%> | ||
const { i18n } = require("./next-i18next.config"); | ||
|
||
module.exports = { | ||
i18n, | ||
transpilePackages: [ | ||
"@refinedev/nextjs-router", | ||
"@refinedev/antd", | ||
"@refinedev/inferencer", | ||
], | ||
}; | ||
<%_ } else if (answers["ui-framework"] === "antd" && answers[`i18n-${answers["ui-framework"]}`] === "no") { _%> | ||
module.exports = {}; | ||
<%_ } else if (answers["ui-framework"] === "antd" && answers["inferencer"] === 'no' && answers[`i18n-${answers["ui-framework"]}`] !== "no") { _%> | ||
const { i18n } = require("./next-i18next.config"); | ||
|
||
module.exports = { | ||
i18n, | ||
transpilePackages: [ | ||
"@refinedev/nextjs-router", | ||
"@refinedev/antd", | ||
], | ||
}; | ||
<%_ } else if (answers["ui-framework"] === "antd" && answers["inferencer"] === 'inferencer' && answers[`i18n-${answers["ui-framework"]}`] === "no") { _%> | ||
module.exports = { | ||
transpilePackages: [ | ||
"@refinedev/nextjs-router", | ||
"@refinedev/antd", | ||
"@refinedev/inferencer", | ||
], | ||
}; | ||
<%_ } else if (answers["ui-framework"] === "antd" && answers["inferencer"] === 'no' && answers[`i18n-${answers["ui-framework"]}`] === "no") { _%> | ||
module.exports = { | ||
transpilePackages: [ | ||
"@refinedev/nextjs-router", | ||
"@refinedev/antd", | ||
], | ||
}; | ||
<%_ } else if (answers[`i18n-${answers["ui-framework"]}`] !== "no") { _%> | ||
const { i18n } = require("./next-i18next.config"); | ||
|
||
module.exports = { | ||
i18n, | ||
transpilePackages: [ | ||
"@refinedev/nextjs-router", | ||
], | ||
}; | ||
<%_ } else { _%> | ||
module.exports = {}; | ||
module.exports = { | ||
transpilePackages: [ | ||
"@refinedev/nextjs-router", | ||
], | ||
}; | ||
<%_ } _%> | ||
|