-
Notifications
You must be signed in to change notification settings - Fork 62
/
webpack.mix.js
58 lines (53 loc) · 1.35 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
const mix = require('laravel-mix');
const modulePath = `${__dirname}/modules/Backend/resources/assets`;
const pluginPath = `${__dirname}/plugins`;
const themePath = `${__dirname}/themes`;
mix.disableNotifications();
mix.options(
{
postCss: [
require('postcss-discard-comments') (
{
removeAll: true
}
)
],
uglify: {
comments: false
}
}
);
if (process.env.npm_config_module) {
require(`${modulePath}/mix.js`);
return;
}
if (process.env.npm_config_theme) {
require(`${themePath}/${process.env.npm_config_theme}/assets/mix.js`);
return;
}
if (process.env.npm_config_plugin) {
require(`${pluginPath}/${process.env.npm_config_plugin}/assets/mix.js`);
return;
}
mix.browserSync({
files: [
'modules/Backend/Http/Controllers/*.php',
'modules/Frontend/Http/Controllers/*.php',
'modules/**/*.blade.php',
'plugins/**/*.blade.php',
'public/**/*.js',
'public/**/*.css',
'themes/**/*.twig',
'resources/views/**/*.blade.php',
],
proxy: process.env.APP_URL,
notify: false,
snippetOptions: {
rule: {
match: /<\/head>/i,
fn: function (snippet, match) {
return snippet + match;
}
}
}
});