-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
66 lines (59 loc) · 2.48 KB
/
webpack.mix.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const mix = require('laravel-mix');
let tailwindcss = require('tailwindcss');
require('dotenv').config();
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.js('resources/js/app.js', 'public/js')
.webpackConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, 'resources/js/src'),
'@assets': path.resolve(__dirname, 'resources/assets'),
'@sass': path.resolve(__dirname, 'resources/sass')
}
}
})
.sass('resources/sass/app.scss', 'public/css').options({
postCss:[require('autoprefixer'), require('postcss-rtl')]
})
.postCss('resources/assets/css/main.css', 'public/css', [
tailwindcss('tailwind.js'), require('postcss-rtl')()
])
.copy('node_modules/vuesax/dist/vuesax.css', 'public/css/vuesax.css') // Vuesax framework css
.copy('resources/assets/css/iconfont.css', 'public/css/iconfont.css') // Feather Icon Font css
.copyDirectory('resources/assets/fonts', 'public/fonts') // Feather Icon fonts
.copyDirectory('node_modules/material-icons/iconfont', 'public/css/material-icons') // Material Icon fonts
.copyDirectory('node_modules/material-icons/iconfont/material-icons.css', 'public/css/material-icons/material-icons.css') // Material Icon fonts css
.copy('node_modules/prismjs/themes/prism-tomorrow.css', 'public/css/prism-tomorrow.css') // Prism Tomorrow theme css
.copyDirectory('resources/assets/images', 'public/images'); // Copy all images from resources to public folder
// Change below options according to your requirement
// if (mix.inProduction()) {
// mix.version();
// mix.webpackConfig({
// output: {
// publicPath: '/demo/vuexy-vuejs-laravel-admin-template/demo-1/',
// chunkFilename: 'js/chunks/[name].[chunkhash].js',
// }
// });
// mix.setResourceRoot("/demo/vuexy-vuejs-laravel-admin-template/demo-1/");
// }
// else{
// mix.webpackConfig({
// output: {
// chunkFilename: 'js/chunks/[name].js',
// }
// });
// }
mix.webpackConfig({
output: {
chunkFilename: 'js/chunks/[name].js',
}
});