-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.mix.js
38 lines (27 loc) · 881 Bytes
/
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
let mix = require('laravel-mix');
let fs = require('fs');
let path = require('path');
const resourcesPath = fs.realpathSync(path.join(__dirname, 'resources'));
const jsFiles = fs.readdirSync(path.join(resourcesPath, 'js'));
const scssFiles = fs.readdirSync(path.join(resourcesPath, 'sass')).filter(str => /^(?!_)[^\\/]+$/.test(str));
mix.disableNotifications();
// const basename = (filename) => filename.replace(/\..+$/, '');
jsFiles.forEach(filename => {
if (!filename.includes('.')) return;
mix.ts(`resources/js/${filename}`, `js`);
});
scssFiles.forEach(filename => {
if (!filename.includes('.')) return;
mix.sass(`resources/sass/${filename}`, 'css');
});
mix.autoload({ 'jquery': ['window.$', 'window.jQuery'] });
mix.preact();
mix.version();
mix.webpackConfig({
resolve: {
fallback: {
'react-native-fs': false,
fs: false,
},
},
});