Created
February 10, 2020 12:20
-
-
Save ufhy/b6537456a40d02b653c83598f146a0a5 to your computer and use it in GitHub Desktop.
Laravel mix configuration using vuetify
This file contains hidden or 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 path = require("path"); | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
const _root = path.resolve(__dirname, "."); | |
const rootPath = function(args) { | |
args = Array.prototype.slice.call(arguments, 0); | |
return path.join.apply(path, [_root].concat(args)); | |
}; | |
mix.setPublicPath('public'); | |
mix.webpackConfig({ | |
resolve: { | |
alias: { | |
'@': rootPath(), | |
} | |
}, | |
output: { | |
chunkFilename: 'dist/[name].js', | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.sass$/, | |
use: [ | |
MiniCssExtractPlugin.loader, | |
{ loader: 'css-loader', options: { sourceMap: false } }, | |
{ | |
loader: 'sass-loader', | |
options: { | |
sourceMap: false, | |
implementation: require("sass"), | |
prependData: "@import '@/resources/scss/variables.scss'", | |
sassOptions: { | |
fiber: require('fibers'), | |
} | |
} | |
} | |
] | |
}, | |
] | |
}, | |
plugins: [ | |
new MiniCssExtractPlugin({ | |
filename: "[name].css", | |
chunkFilename: "[name].css", | |
ignoreOrder: false | |
}), | |
], | |
externals: { | |
"vue": "Vue", | |
} | |
}); | |
if (mix.inProduction()) { | |
mix.copy('node_modules/vue/dist/vue.min.js', 'public/dist/vue.js'); | |
} else { | |
mix.copy('node_modules/vue/dist/vue.js', 'public/dist/vue.js'); | |
} | |
mix.js('resources/js/vuetify.js', 'public/dist'); | |
mix.js('resources/js/auth.js', 'public/dist'); | |
mix.js('resources/js/app.js', 'public/dist'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment