It is a project developed with Next js that pulls data from The Movie Datase API.
-
npx create-next-app nextjs-blog --use-npm --example "https://github.com/vercel/next-learn-starter/tree/master/learn-starter"
npm run devStarts the development server.npm run buildBuilds the app for production.npm startRuns the built app in production mode.We suggest that you begin by typing:
cd nextjs-blognpm run dev -
npm install --save-dev typescript @types/react @types/nodeis install dependencies -
touch tsconfig.jsoncreatetsconfigfile -
npm install tailwindcss postcss-preset-env postcss-flexbugs-fixesis install scss properties -
Add
postcss.config.jsto root with this content
// postcss.config.js
module.exports = {
plugins: [
'tailwindcss',
'postcss-flexbugs-fixes',
[
'postcss-preset-env',
{
autoprefixer: {
flexbox: 'no-2009'
},
stage: 3,
features: {
'custom-properties': false
}
}
]
]
}- Add "tailwind.config.js" to root and its content
// tailwind.config.js
module.exports = {
purge: [
// Use *.tsx if using TypeScript
'./pages/**/*.js',
'./components/**/*.js'
]
// ...
}- npm install sass
- Add "next.config.js" to root and its SASS configuration
const path = require('path')
// includePaths
module.exports = {
sassOptions: {
includePaths: [path.join(__dirname, 'styles')],
},
}