forked from verbb/vizy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
72 lines (59 loc) · 1.57 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
const mix = require('laravel-mix');
const path = require('path');
// Mix plugins
const autoprefixer = require('autoprefixer');
const eslint = require('laravel-mix-eslint');
const imagemin = require('laravel-mix-imagemin');
const assetsPath = './src/web/assets';
// Set the public path
mix.setPublicPath(assetsPath);
//
// Vizy Field
//
// Setup and configure Sass
mix.sass(assetsPath + '/field/src/scss/style.scss', assetsPath + '/field/dist/css');
// Setup and configure JS
mix.js(assetsPath + '/field/src/js/main.js', assetsPath + '/field/dist/js');
// Vue 2
mix.vue({ version: 2 });
mix.override((config) => {
delete config.watchOptions;
});
// Setup additional CSS-related options including Tailwind and any other PostCSS items
mix.options({
// Disable processing css urls for speed
processCssUrls: false,
postCss: [
// PostCSS plugins
autoprefixer(),
],
});
// Setup some aliases
mix.webpackConfig({
resolve: {
alias: {
'@utils': path.resolve(__dirname, assetsPath + '/field/src/js/utils'),
},
},
externals: {
vue: 'Vue',
},
});
// Setup JS-linting
mix.eslint({
fix: true,
cache: false,
exclude: [
'node_modules',
],
});
// Always allow versioning of assets
mix.version();
// Add polyfills
// mix.polyfill({
// enabled: true,
// useBuiltIns: 'usage', // Only add a polyfill when a feature is used
// targets: false, // "false" makes the config use .browserslistrc file
// corejs: 3,
// debug: false, // "true" to check which polyfills are being used
// });