2020-11-06 03:33:14 +01:00
|
|
|
import chalk from 'chalk'
|
2019-12-09 21:08:15 +01:00
|
|
|
|
|
|
|
export function getGlobalImportError(file: string | null) {
|
|
|
|
return `Global CSS ${chalk.bold(
|
|
|
|
'cannot'
|
|
|
|
)} be imported from files other than your ${chalk.bold(
|
|
|
|
'Custom <App>'
|
|
|
|
)}. Please move all global CSS imports to ${chalk.cyan(
|
|
|
|
file ? file : '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')}.`
|
|
|
|
}
|