I am trying to install Tailwind into my Laravel 5.8 app and am using Laravel Mix. I've installed tailwind npm package and generated a tailwind config file. A file exists at the resources/sass/app.scss path but when I go to compile with npm run watch I get an error that a dependency was not found. How can I fix this and use Tailwind in my Laravel 5.8 project?
ERROR Failed to compile with 1 errors 12:16:17 PM
This dependency was not found:
* /Users/connorleech/Projects/employbl/resources/sass/app.scss in multi ./resources/assets/js/app.js ./resources/sass/app.scss
To install it, you can run: npm install --save /Users/connorleech/Projects/employbl/resources/sass/app.scss
Asset Size Chunks Chunk Names
/js/app.js 2.37 MB 0 [emitted] [big] /js/app
ERROR in multi ./resources/assets/js/app.js ./resources/sass/app.scss
Module not found: Error: Can't resolve '/Users/connorleech/Projects/employbl/resources/sass/app.scss' in '/Users/connorleech/Projects/employbl'
@ multi ./resources/assets/js/app.js ./resources/sass/app.scss
This is my webpack.mix.js file:
let mix = require('laravel-mix');
const tailwindcss = require('tailwindcss');
mix.js('resources/assets/js/app.js', 'public/js').version();
mix.sass('resources/sass/app.scss', 'public/css')
.options({
processCssUrls: false,
postCss: [ tailwindcss('./tailwind.config.js') ],
});
These are the dependencies in my package.json:
"devDependencies": {
"axios": "^0.16.2",
"bootstrap": "^4.1.1",
"bootstrap-sass": "^3.3.7",
"cross-env": "^5.0.1",
"jquery": "^3.1.1",
"laravel-mix": "^1.0",
"lodash": "^4.17.11",
"popper.js": "^1.14.3",
"sass-loader": "^8.0.2",
"vue": "^2.5.15"
},
"dependencies": {
"laravel-vue-pagination": "^2.3.0",
"moment": "^2.24.0",
"npm": "^6.2.0",
"pleasejs": "^0.4.2",
"prod": "^1.0.1",
"querystring": "^0.2.0",
"run": "^1.4.0",
"tailwindcss": "^1.2.0",
"vue-multiselect": "^2.1.3",
"vue-router": "^2.8.1",
"vue-ua": "^1.5.0",
"vuex": "^3.1.0"
}