-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
83 lines (77 loc) · 1.86 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
const mix = require("laravel-mix");
const path = require('path');
//const buildPath = 'build';
mix.disableNotifications();
mix.options(
{
postCss: [
require('postcss-discard-comments')(
{
removeAll: true
}
)
],
uglify: {
comments: false
},
terser: {
extractComments: false,
terserOptions: {
output: {
comments: false,
},
},
},
}
);
// mix.setResourceRoot(`/${buildPath}`);
// mix.setPublicPath(`public/${buildPath}`);
mix.webpackConfig({
resolve: {
extensions: [".ts", ".tsx"],
alias: {
'~': path.resolve(__dirname, 'resources/js/'),
},
},
output: {
chunkFilename: mix.inProduction() ? "js/chunks/[name].[chunkhash].js" : "js/chunks/dev/[name].js",
filename: "[name].js",
//clean: true,
},
});
mix.js("resources/js/app.tsx", "js/app.js")
.extract([
'react',
'react-dom',
'react-router-dom',
'react-redux',
'react-dom/client',
'react-hook-form',
], 'js/vendor-core.min.js')
.extract()
.react()
.postCss("resources/css/app.css", "css/app.css", [
//
]);
mix.version();
if (!mix.inProduction()) {
mix.browserSync({
files: [
'modules/**/Http/Controllers/*.php',
'modules/**/*.blade.php',
'public/**/*.js',
'public/**/*.sass',
'public/**/*.css',
],
proxy: process.env.APP_URL,
notify: false,
snippetOptions: {
rule: {
match: /<\/head>/i,
fn: function (snippet, match) {
return snippet + match;
}
}
}
});
}