-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.mix.js.dcatonly
More file actions
99 lines (88 loc) · 2.58 KB
/
webpack.mix.js.dcatonly
File metadata and controls
99 lines (88 loc) · 2.58 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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
const { EnvironmentPlugin } = require('webpack');
const mix = require('laravel-mix');
const glob = require('glob');
const path = require('path');
/*
|--------------------------------------------------------------------------
| Configure mix
|--------------------------------------------------------------------------
*/
mix.options({
resourceRoot: process.env.ASSET_URL || undefined,
processCssUrls: false,
postCss: [require('autoprefixer')]
});
/*
|--------------------------------------------------------------------------
| Configure Webpack
|--------------------------------------------------------------------------
*/
mix.webpackConfig({
output: {
publicPath: process.env.ASSET_URL || undefined,
libraryTarget: 'umd'
},
plugins: [
new EnvironmentPlugin({
// Application's public url
BASE_URL: process.env.ASSET_URL ? `${process.env.ASSET_URL}/` : '/'
})
],
module: {
rules: [
{
test: /\.es6$|\.js$/,
include: [
path.join(__dirname, 'node_modules/bootstrap/'),
path.join(__dirname, 'node_modules/popper.js/'),
path.join(__dirname, 'node_modules/shepherd.js/')
],
loader: 'babel-loader',
options: {
presets: [['@babel/preset-env', { targets: 'last 2 versions, ie >= 10' }]],
plugins: [
'@babel/plugin-transform-destructuring',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-transform-template-literals'
],
babelrc: false
}
}
]
},
externals: {
jquery: 'jQuery',
moment: 'moment',
jsdom: 'jsdom',
velocity: 'Velocity',
hammer: 'Hammer',
pace: '"pace-progress"',
chartist: 'Chartist',
'popper.js': 'Popper',
// blueimp-gallery plugin
'./blueimp-helper': 'jQuery',
'./blueimp-gallery': 'blueimpGallery',
'./blueimp-gallery-video': 'blueimpGallery'
}
});
/*
|--------------------------------------------------------------------------
| Vendor assets
|--------------------------------------------------------------------------
*/
function mixAssetsDir(query, cb) {
(glob.sync('resources/assets/' + query) || []).forEach(f => {
f = f.replace(/[\\\/]+/g, '/');
cb(f, f.replace('resources/assets/', 'resources/dist/'));
});
}
/*
|--------------------------------------------------------------------------
| Configure sass
|--------------------------------------------------------------------------
*/
const sassOptions = {
precision: 5
};
//Dcat
mixAssetsDir('dcat/js/dcat-app.js', (src, dest) => mix.js(src, dest));