forked from filamentphp/filament
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
76 lines (68 loc) · 1.77 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
require('dotenv').config()
let mix = require('laravel-mix')
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your application.
|
*/
// Config
const SRC = 'resources'
const DIST = 'dist'
// set paths
mix.setPublicPath(DIST)
mix.setResourceRoot(`/${SRC}/`)
/**
* Process Javascript
*
* @link https://laravel.com/docs/master/mix#working-with-scripts
*/
mix.js(`${SRC}/js/filament.js`, 'js')
/**
* Process CSS via PostCSS
*
*
* @link https://laravel.com/docs/master/mix#postcss
*/
mix.postCss(`${SRC}/css/filament.css`, 'css', [
require('postcss-import'),
require('tailwindcss'),
require('postcss-nested'),
require('autoprefixer'),
])
/**
* Sourcemaps
*
* Provide extra debugging information to your browser's
* developer tools when using compiled assets.
*
* @link https://laravel.com/docs/master/mix#css-source-maps
*/
mix.sourceMaps()
if (mix.inProduction()) {
/**
* Versioning / Cache Busting
*
* After generating the versioned file, you won't know the exact file name.
* So, you should use Laravel's global mix function within your views
* to load the appropriately hashed asset.
*
* @link https://laravel.com/docs/master/mix#versioning-and-cache-busting
*/
mix.version()
}
/**
* BrowserSync
*
* Automatically monitor your files for changes,
* and inject your changes into the browser without requiring a manual refresh
*
* @link https://laravel.com/docs/master/mix#browsersync-reloading
*/
mix.browserSync({
proxy: process.env.BROWSERSYNC_PROXY || 'http://127.0.0.1:8000',
https: process.env.BROWSERSYNC_HTTPS || false,
})