-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.mix.js
More file actions
39 lines (35 loc) · 1.18 KB
/
webpack.mix.js
File metadata and controls
39 lines (35 loc) · 1.18 KB
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
const mix = require('laravel-mix');
const path = require('path');
require('./config/build/sync-component');
// Base paths
const srcPath = 'src';
const publicPath = 'dist/public_html';
const distPath = path.join(publicPath, 'assets');
// Mix configuration
mix
.setPublicPath(distPath)
.setResourceRoot('/assets/')
.sourceMaps(true, 'source-map')
.version()
.browserSync({
proxy: 'localhost',
files: ['dist/templates/**/*', path.join(distPath, 'styles/*.css')],
open: false,
xip: true,
reloadOnRestart: false,
});
// Replace default image loader
Mix.listen('configReady', require('./config/build/image-loader'));
// Build everything
mix
.js(path.join(srcPath, 'scripts/initial.js'), 'scripts')
.js(path.join(srcPath, 'scripts/main.js'), 'scripts')
.js(path.join(srcPath, 'scripts/directory.js'), 'scripts')
.copy(
['./node_modules/picturefill/dist/picturefill.min.js'],
path.join(distPath, 'scripts')
)
.sass(path.join(srcPath, 'styles/main.scss'), 'styles')
.sync(path.join(srcPath, 'templates'), 'dist/templates')
.copy(path.join(srcPath, 'images'), path.join(distPath, 'images'))
.copy(path.join(srcPath, 'icons'), path.join(distPath, 'icons'));