Skip to content

Commit 83be354

Browse files
committed
Tweak CRA config init docs
1 parent 946e68b commit 83be354

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

remark/withPrevalInstructions.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,12 @@ function createPrevals({ tool: pageTool = error('UNKNOWN') } = {}) {
132132
${npmInstall ? code('shell', 'npm install') : ''}
133133
`)
134134
},
135-
configuration({ purge = [], types = ['pages', 'components'], postcss = true }) {
135+
configuration({
136+
purge = [],
137+
version = 'latest',
138+
types = ['pages', 'components'],
139+
postcss = true,
140+
}) {
136141
let files = ['tailwind.config.js', postcss && 'postcss.config.js']
137142
.filter(Boolean)
138143
.map(quote('`'))
@@ -143,7 +148,12 @@ function createPrevals({ tool: pageTool = error('UNKNOWN') } = {}) {
143148
144149
Next, generate your ${joinAsSpeech(files)} ${multipleFiles ? 'files' : 'file'}:
145150
146-
${code('shell', `npx tailwindcss init ${postcss ? '-p' : ''}`)}
151+
${code(
152+
'shell',
153+
`npx tailwindcss${version === 'compat-7' ? '-cli@latest' : ''} init ${
154+
postcss ? '-p' : ''
155+
}`
156+
)}
147157
148158
This will create a minimal \`tailwind.config.js\` file at the root of your project:
149159

src/pages/docs/guides/create-react-app.mdx

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ tool: Create React App
66

77
```preval installation
88
reference:
9-
name: Create React App
10-
link: https://create-react-app.dev/
9+
name: Create React App
10+
link: https://create-react-app.dev/
1111
script: npx create-react-app
1212
```
1313

@@ -61,10 +61,11 @@ module.exports = {
6161
If you're planning to use any other PostCSS plugins, you should read our documentation on [using PostCSS as your preprocessor](/docs/using-with-preprocessors) for more details about the best way to order them alongside Tailwind.
6262

6363
```preval configuration
64+
version: compat-7
6465
postcss: false
6566
types:
6667
- components
67-
purge:
68+
purge:
6869
- ./src/**/*.{js,jsx,ts,tsx}
6970
- ./public/index.html
7071
```

0 commit comments

Comments
 (0)