Created
October 26, 2020 05:19
-
-
Save earvinpiamonte/7de9813dfadde2306d834e97c7ed321f to your computer and use it in GitHub Desktop.
Webpack setup with Tailwind CSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mix = require("laravel-mix"); | |
/* | |
|-------------------------------------------------------------------------- | |
| Mix Asset Management | |
|-------------------------------------------------------------------------- | |
| | |
| Mix provides a clean, fluent API for defining some Webpack build steps | |
| for your Laravel applications. By default, we are compiling the CSS | |
| file for the application as well as bundling up all the JS files. | |
| | |
*/ | |
const ENV = process.env; | |
const filesToWatch = [ | |
"app/**/*.php", | |
"resources/views/**/*.php", | |
"public/js/**/*.js", | |
"public/css/**/*.css" | |
]; | |
mix.browserSync({ | |
host: ENV.APP_URL.replace("http://", "").replace("https://", ""), | |
proxy: ENV.APP_URL, | |
open: false, | |
files: filesToWatch, | |
watchOptions: { | |
usePolling: true | |
} | |
}) | |
.js("resources/js/app.js", "public/js") | |
.postCss("resources/css/app.css", "public/css", [ | |
require("tailwindcss"), | |
require("autoprefixer") | |
]) | |
.disableNotifications(); | |
if (mix.inProduction()) { | |
mix.version(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add
serve
to thepackage.json
.eg. stripped package.json