-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.mix.js
61 lines (54 loc) · 1.35 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
// 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: true
})
mix.twig('src/templates', 'public', {
format: mix.inProduction() ? 'minify' : 'pretty'
})
mix.ts('src/js/app.ts', 'js')
mix.ts('src/js/carousel.ts', 'js')
mix.ts('src/js/utils/lazysizes-wrapper.ts', 'js')
mix.postCss('src/css/app.css', 'css')
mix.postCss('src/css/pardot-form.css', 'css')
mix.copyDirectory('src/img/**', 'public/img')
mix.copyDirectory('static/**', 'public')
// mix.criticalCss({
// enabled: false,
// paths: {
// base: 'https://localhost:3030',
// templates: './public/_criticalcss/',
// suffix: '_critical.min'
// },
// urls: [{ url: '/', template: 'index' }],
// options: {
// minify: true
// }
// })
if (!mix.inProduction()) {
mix.sourceMaps()
mix.webpackConfig(() => {
return {
plugins: [
new BrowserSyncPlugin({
host: 'localhost',
port: 3030,
watch: true,
server: {
baseDir: ['public'],
serveStaticOptions: {
extensions: ['html']
}
}
})
]
}
})
}