This repository has been archived by the owner on Sep 21, 2023. It is now read-only.
forked from AranduTech/laravel-mui-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
48 lines (44 loc) · 1.65 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
const mix = require('laravel-mix');
const CircularDependencyPlugin = require('circular-dependency-plugin');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
const packageJson = require('./package.json');
const dependencies = Object.keys(packageJson.dependencies);
mix.js('resources/js/guest.js', 'public/js')
.js('resources/js/authenticated.js', 'public/js')
.js('resources/js/admin.js', 'public/js')
.extract(dependencies)
.sourceMaps(false)
.react()
.sass('resources/sass/app.scss', 'public/css')
.webpackConfig({
plugins: [
new CircularDependencyPlugin({
// exclude detection of files based on a RegExp
exclude: /a\.js|node_modules/,
// add errors to webpack instead of warnings
failOnError: true,
// allow import cycles that include an asyncronous import,
// e.g. via import(/* webpackMode: "weak" */ './file.js')
allowAsyncCycles: false,
// set the current working directory for displaying module paths
cwd: process.cwd(),
})
],
module: {
rules: [
{
test: /\.jsonc$/,
loader: 'json-loader'
}
]
}
});