Last active
October 20, 2019 06:20
-
-
Save bedus-creation/1a74bccea15c8006ea956394d4474912 to your computer and use it in GitHub Desktop.
Laravel Mix V3 setup with dynamic import, tailwind, Vue, vendor extraction.
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
Show hidden characters
// { | |
// "plugins": [ | |
// "@babel/plugin-syntax-dynamic-import" | |
// ] | |
// } | |
{ | |
"plugins": [ | |
"syntax-dynamic-import" | |
] | |
} |
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
{ | |
"private": true, | |
"scripts": { | |
"dev": "npm run development", | |
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | |
"watch": "npm run development -- --watch", | |
"watch-poll": "npm run watch -- --watch-poll", | |
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", | |
"prod": "npm run production", | |
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" | |
}, | |
"devDependencies": { | |
"axios": "^0.18", | |
"sass-loader": "^7.1.0", | |
"babel-plugin-syntax-dynamic-import": "^6.18.0", | |
"cross-env": "^5.1", | |
"laravel-mix": "^3.0", | |
"laravel-mix-purgecss": "^4.1.0", | |
"lodash": "^4.17.4", | |
"tailwindcss": "^1.1.2", | |
"vue": "^2.5.7", | |
} | |
} |
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
//resources/sass/tailwind.css | |
@tailwind base; | |
@tailwind components; | |
@tailwind utilities; |
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'); | |
const tailwindcss = require('tailwindcss'); | |
require('laravel-mix-purgecss'); | |
mix.webpackConfig({ | |
resolve: { | |
extensions: ['.js', '.vue', '.json'], | |
alias: { | |
'@': __dirname + '/resources/js' | |
}, | |
}, | |
output: { | |
chunkFilename: 'js/chunks/[name].js?id=[hash]', | |
}, | |
}); | |
mix.js('resources/js/app.js', 'public/js') | |
.extract(['vue']); | |
mix.sass('resources/sass/app.scss', 'public/css'); | |
mix.postCss('resources/sass/tailwind.css', 'public/css', [ | |
require('tailwindcss'), | |
]).purgeCss(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment