-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
66 lines (61 loc) · 1.31 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
66
let mix = require( 'laravel-mix' );
/*
* Extend Laravel Mix
*/
require( '@adapt-retail/adapt-mix-extender' ).extend( mix );
/**
* Helper for doing different things when
* running "npm run watch" and "npm run prod"
*
* adapt-print
* Add $id before everything when running
* npm run prod
*
* adapt-production
* Only show content in production
*
* adapt-development
* Only show content in development
*
*/
var buildAdaptMixin = function() {
if (mix.inProduction()) {
return `
@mixin adapt-print {
#{'$id'} {
@content;
}
}
@mixin adapt-production {
@content;
}
@mixin adapt-development {
#not-used {
@content;
}
}
`;
}
return `
@mixin adapt-print {
@content;
}
@mixin adapt-production {
#not-used {
@content;
}
}
@mixin adapt-development {
@content;
}
`;
}
/*
* Build script and compile sass
* Display banner and hot reload
*/
mix.js('src/Scripts/main.js', 'dist/snippet.js')
.sass('src/Style/main.scss', 'dist/snippet.css', {
data: buildAdaptMixin(),
})
.browserSync();