-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwebpack.mix.js
47 lines (41 loc) · 1.06 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
// Imports
const mix = require('laravel-mix')
const BrowserSyncPlugin = require('browser-sync-webpack-plugin')
require('@webrgp/laravel-mix-twig')
require('laravel-mix-criticalcss')
mix.disableSuccessNotifications()
mix.setPublicPath('public')
mix.version()
mix.extract(['lazysizes']);
mix.options({
legacyNodePolyfills: false
});
mix.twig("src/templates", "public")
mix.ts("src/js/app.ts", "public/js")
mix.ts("src/js/cards-slider.ts", "public/js")
mix.ts("src/js/utils/lazysizes-wrapper.ts", "public/js")
mix.postCss("src/css/app.css", "public/css")
mix.copyDirectory('src/img/**', 'public/img')
if (!mix.inProduction()) {
mix.sourceMaps();
mix.webpackConfig(() => {
return {
stats: {
children: false // change to true for more detail warnings
},
plugins: [
new BrowserSyncPlugin({
host: 'localhost',
port: 3030,
watch: true,
server: {
baseDir: ['public'],
serveStaticOptions: {
extensions: ['html']
}
}
})
]
};
});
}