Autocomplete taiwindcss class not worked in webpack
تبليغيرجى شرح بإيجاز لمإذا تشعر أنك ينبغي الإبلاغ عن هذا السؤال.
I use webpack and use tailwindcss for my styles.
But when I want use tailwindcss classes in my html files, autocomplete not worked in my phpstorm editor (tailwindcss plugin enable in phpstorm IDE).
How can I fix this problem?
My package.json file is:
{
“name”: “template”,
“version”: “1.0.0”,
“description”: “”,
“private”: true,
“scripts”: {
“test”: “echo “Error: no test specified” && exit 1″,
“build”: “webpack”
},
“keywords”: [],
“author”: “”,
“license”: “ISC”,
“devDependencies”: {
“autoprefixer”: “^10.4.7”,
“css-loader”: “^6.7.1”,
“postcss”: “^8.4.14”,
“postcss-loader”: “^7.0.0”,
“style-loader”: “^3.3.1”,
“tailwindcss”: “^3.1.5”,
“webpack”: “^5.73.0”,
“webpack-cli”: “^4.10.0”
},
“dependencies”: {
“lodash”: “^4.17.21”
}
}
My webpack.config.js file is:
const path = require(‘path’);
module.exports = {
entry: ‘./src/index.js’,
output: {
filename: ‘bundle.js’,
path: path.resolve(__dirname, ‘dist/build’),
clean: true,
},
mode: ‘development’,
module: {
rules: [
{
test: /.css$/i,
use: [‘style-loader’, ‘css-loader’, ‘postcss-loader’],
},
{
test: /.(png|svg|jpg|jpeg|gif)$/i,
type: ‘asset/resource’,
},
{
test: /.(woff|woff2|eot|ttf|otf)$/i,
type: ‘asset/resource’,
},
],
},
watch: true,
};
My index.html file is:
<!doctype html>
<html lang=”en”>
<head>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
<meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<title>Test</title>
</head>
<body>
<div class=”w-full h-8 bg-sky-500 text-red-500″></div>
<script src=”build/bundle.js”></script>
</body>
</html>
My style.css file is:
@tailwind base;
@tailwind components;
@tailwind utilities;
أضف إجابة