前提・実現したいこと
NextJS と TailwindCSS の環境下でコーディングしたWEBサイトを、NetlifyをGitHub経由でデプロイしました。デプロイはNetlify上で成功と表示がありましたが、実際にサイトを見てみるとCSSが全く効いておらず、ただのhtmlのサイトとして表示されました。
原因を特定し、開発環境では整えられたWEBサイトを本番環境(デプロイ後)でも同じように表示させたいです。
発生している問題・エラーメッセージ
- 開発者ツールのコンソール
下記エラーメッセージを吐いていました。
Uncaught SyntaxError: Unexpected token '<'
- 各種ファイルについて
tailwind.config.js
1module.exports = { 2 mode: 'jit', 3 purge:[ 4 './pages/**/*.{js,ts,jsx,tsx}', 5 './components/**/*.{js,ts,jsx,tsx}', 6 './molecules/**/*.{js,ts,jsx,tsx}', 7 './atoms/**/*.{js,ts,jsx,tsx}',
postcss.config.js
1module.exports = { 2 plugins: { 3 tailwindcss: {}, 4 autoprefixer: {}, 5 }, 6}
package.json
1 "scripts": { 2 "dev": "next dev", 3 "build": "next build", 4 "start": "next start", 5 "lint": "next lint", 6 "export": "next export", 7 "deploy": "npm run build && npm run export" 8 }
next.config.js
1module.exports = { 2 reactStrictMode: true, 3 target: 'serverless', 4 distDir: 'out', 5}
netlify.toml
1[[redirects]] 2 from = "/*" 3 to = "/index.html" 4 status = 200 5 6[[plugins]] 7 package = "@netlify/plugin-nextjs" 8 9[build] 10 command = "npm run build" 11 functions = "out_functions" 12 publish = "out"
アドバイスでもヒントでも構いません。
何卒、よろしくおねがいします。
あなたの回答
tips
プレビュー