-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
54 lines (45 loc) · 1.02 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
const mix = require('laravel-mix');
const tailwindcss = require('tailwindcss');
/*
* Assets dirs
*
* */
const assets = {
base: 'resources/assets/',
path: function (end) {
return this.base + end;
},
};
/*
* Web
*
* */
// Copy images directory
mix.copyDirectory(assets.path('web/images'), 'public/assets/web/images');
/*
* Admin
*
* */
// Scripts
mix.js(assets.path('admin/vue/application.js'), 'assets/' + process.env.APP_ADMIN_DIR + '/js')
.version();
// Styles
mix.sass(assets.path('admin/scss/app.scss'), 'assets/' + process.env.APP_ADMIN_DIR + '/css')
.options({
processCssUrls: false,
postCss: [
tailwindcss('./tailwind.config.js'),
],
})
.version();
// Copy images directory
mix.copyDirectory(assets.path('admin/images'), 'public/assets/' + process.env.APP_ADMIN_DIR + '/images');
// Webpack config
mix.webpackConfig({
resolve: {
alias: {
'@assets': path.resolve(__dirname, assets.path('admin/scss')),
'@': path.resolve(__dirname, assets.path('admin/vue')),
},
},
});