-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
53 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
49
50
51
52
53
let mix = require('laravel-mix');
mix
// Compile the main Sass files.
.sass('resources/assets/sass/main.scss', 'public/css')
.sass('resources/assets/sass/admin.scss', 'public/css')
.scripts('resources/assets/js/stats.js', 'public/js/stats.js')
.babel('resources/assets/js/main.js', 'public/js/main.js')
.babel('resources/assets/js/home.js', 'public/js/home.js')
.babel(
'resources/assets/js/dynamic-osm-maps.js',
'public/js/dynamic-osm-maps.js',
)
.babel(
'resources/assets/js/general-osm-map.js',
'public/js/general-osm-map.js',
)
// Publish assets for front-end dependencies.
.copy('node_modules/leaflet/dist', 'public/vendor/leaflet')
.copy(
'node_modules/leaflet.markercluster/dist',
'public/vendor/leaflet.markercluster'
)
.copy(
'node_modules/leaflet.featuregroup.subgroup/dist',
'public/vendor/leaflet.featuregroup.subgroup'
)
.options({
// Prevent Webpack to do incredibly stupid things by trying to
// be clever and thinking he can process our external assets.
processCssUrls: false
})
// Mix, please do shut up and stop bothering people every three seconds.
.disableNotifications();
if (mix.inProduction()) {
// Enable pseudo-file versioning to avoid any caching issue.
mix.version();
} else {
// Partly fix the generation of source maps, which has apparently
// been broken by Jeffrey…
// See https://github.com/JeffreyWay/laravel-mix/issues/879
mix.webpackConfig({ devtool: "inline-source-map" });
// Enable source maps for easier debugging.
mix.sourceMaps();
}