-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.mix.js
More file actions
executable file
·42 lines (35 loc) · 1.12 KB
/
webpack.mix.js
File metadata and controls
executable file
·42 lines (35 loc) · 1.12 KB
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
let mix = require('laravel-mix');
// setting the public directory to public (this is where the mix-manifest.json gets created)
mix.setPublicPath('assets/')
// transpiling, babelling, minifying and creating the public/js/main.js out of our assets
// .sass('resources/sass/main.scss', 'public/css')
// .sass('resources/sass/admin/admin.scss', 'public/css/admin')
/* For VueJS Scripts */
const scriptsFolder = 'VueJs/js/';
const fs = require('fs');
fs.readdirSync(scriptsFolder).forEach(file => {
mix.js(scriptsFolder + file, 'assets/js/' + file);
})
/* VueJS Scripts End */
/* For SASS Scripts */
const SCSSFolder = 'SCSS/';
fs.readdirSync(SCSSFolder).forEach(file => {
mix.sass(SCSSFolder + file, 'assets/css/' );
})
/* SASS Scripts End */
// aliases so instead of e.g. '../../components/test' we can import files like '@/components/test'
mix.webpackConfig({
resolve: {
alias: {
"@": path.resolve(
__dirname,
"VueJS/js"
),
"@sass": path.resolve(
__dirname,
"SCSS"
),
}
}
});
mix.version()