2021-12-21 16:13:45 +01:00
|
|
|
import chalk from 'next/dist/compiled/chalk'
|
2019-12-09 21:08:15 +01:00
|
|
|
|
2021-08-19 10:12:12 +02:00
|
|
|
export function getGlobalImportError() {
|
2019-12-09 21:08:15 +01:00
|
|
|
return `Global CSS ${chalk.bold(
|
|
|
|
'cannot'
|
|
|
|
)} be imported from files other than your ${chalk.bold(
|
|
|
|
'Custom <App>'
|
2021-07-25 06:53:33 +02:00
|
|
|
)}. Due to the Global nature of stylesheets, and to avoid conflicts, Please move all first-party global CSS imports to ${chalk.cyan(
|
2021-08-19 10:12:12 +02:00
|
|
|
'pages/_app.js'
|
2021-03-29 10:25:00 +02:00
|
|
|
)}. Or convert the import to Component-Level CSS (CSS Modules).\nRead more: https://nextjs.org/docs/messages/css-global`
|
2019-12-09 21:08:15 +01:00
|
|
|
}
|
2019-12-11 11:46:12 +01:00
|
|
|
|
2019-12-27 19:35:37 +01:00
|
|
|
export function getGlobalModuleImportError() {
|
|
|
|
return `Global CSS ${chalk.bold(
|
|
|
|
'cannot'
|
2020-01-10 16:40:28 +01:00
|
|
|
)} be imported from within ${chalk.bold(
|
|
|
|
'node_modules'
|
2021-03-29 10:25:00 +02:00
|
|
|
)}.\nRead more: https://nextjs.org/docs/messages/css-npm`
|
2019-12-27 19:35:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export function getLocalModuleImportError() {
|
2019-12-11 11:46:12 +01:00
|
|
|
return `CSS Modules ${chalk.bold(
|
|
|
|
'cannot'
|
2020-01-10 17:45:01 +01:00
|
|
|
)} be imported from within ${chalk.bold(
|
|
|
|
'node_modules'
|
2021-03-29 10:25:00 +02:00
|
|
|
)}.\nRead more: https://nextjs.org/docs/messages/css-modules-npm`
|
2019-12-11 11:46:12 +01:00
|
|
|
}
|
2020-01-14 20:53:42 +01:00
|
|
|
|
|
|
|
export function getCustomDocumentError() {
|
|
|
|
return `CSS ${chalk.bold('cannot')} be imported within ${chalk.cyan(
|
|
|
|
'pages/_document.js'
|
|
|
|
)}. Please move global styles to ${chalk.cyan('pages/_app.js')}.`
|
|
|
|
}
|