-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
109 lines (94 loc) · 3.73 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
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
100
101
102
103
104
105
106
107
108
109
let mix = require('laravel-mix');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
let config = {
plugins: [
new CleanWebpackPlugin({
// dry: true,
verbose: true,
cleanOnceBeforeBuildPatterns: [
'**/*',
'!views','!views/**/*',
'!lang','!lang/**/*',
'!js', '!js/plugins',
'!js/plugins/omenButton.jquery.plugin.min.js',
'!js/plugins/tinymce.omen.plugin.min.js'
],
// hack to remove unwanted assets emmited from plugins
cleanAfterEveryBuildPatterns: [
'fonts/vendor'
],
}),
]
};
if (process.env.NODE_ENV == 'production') {
mix.disableNotifications();
config.devtool = 'nosources-source-ma';
}
if (process.env.NODE_ENV != 'production') {
// mix.browserSync('test.local');
mix.version();
mix.sourceMaps();
config.devtool = 'inline-source-map';
}
mix.webpackConfig(config);
mix.setPublicPath('resources');
mix.copy('node_modules/@mdi/font/fonts/', 'resources/fonts/');
mix.copy('src/images/favicon/dist/', 'resources/images/favicon/');
mix.copy('src/images/whitenoise-361x370.png', 'resources/images/');
mix.copy('src/images/loading.svg', 'resources/images/');
mix.copy('src/images/shadow.png', 'resources/images/');
mix.copy('src/images/griphandle.png', 'resources/images/');
mix.copy('src/images/fancytree-li.gif', 'resources/images/vendor/fancytree/');
mix.copy('node_modules/bootstrap-fileinput/img/loading.gif', 'resources/images/vendor/bootstrap-fileinput/');
mix.copy('node_modules/bootstrap-fileinput/img/loading-sm.gif', 'resources/images/vendor/bootstrap-fileinput/');
mix.copy('node_modules/mediaelement/build/mejs-controls.svg', 'resources/images/vendor/mediaelement/');
mix.copy('node_modules/mediaelement/build/mejs-controls.png', 'resources/images/vendor/mediaelement/');
mix.copy('node_modules/mediaelement/build/mediaelement-flash-video.swf', 'resources/images/vendor/mediaelement/');
mix.copy('node_modules/mediaelement/build/lang', 'resources/js/vendor/mediaelement/');
mix.sass('src/resources/sass/app.scss', 'css/__sass_omen.css');
mix.sass('src/resources/sass/omen/pdfCanvas.scss', 'css/omenPdf.css');
mix.less('src/resources/less/dependency.less', 'css/__less_omen.css');
mix.styles([
'node_modules/mediaelement/build/mediaelementplayer.css',
'resources/css/__less_omen.css',
'resources/css/__sass_omen.css',
'node_modules/simplebar/dist/simplebar.css',
'node_modules/highlight.js/scss/vs2015.scss',
], 'resources/css/omen.css');
mix.coffee(['src/resources/coffee/app.coffee'], 'js/omen.js').extract([
'bootstrap',
'popper.js',
'jquery',
'lodash',
'jquery.fancytree',
'js-base64',
'lazyload',
'highlight.js',
'mediaelement',
'fuzzysearch',
'fuzzyset.js',
'split.js',
// Simplebar depenencies
'resize-observer-polyfill',
'lodash.throttle',
'lodash.memoize',
'lodash.debounce',
'can-use-dom',
'core-js',
// Simplebar
'simplebar',
'progressbar.js',
'shifty',
'bootstrap-fileinput',
'jquery-contextmenu',
'jquery-ui',
'cropperjs',
'bezier-easing',
'@shopify/draggable',
'wheelzoom'
]);
mix.scripts('node_modules/mediaelement/build/mediaelement-and-player.js', 'resources/js/vendor/mediaelement.min.js');
mix.scripts('node_modules/pdfjs-dist/build/pdf.js', 'resources/js/vendor/pdf.min.js');
mix.scripts('node_modules/pdfjs-dist/build/pdf.worker.js', 'resources/js/vendor/pdf.worker.min.js');
mix.scripts('node_modules/pdfjs-dist/web/pdf_viewer.js', 'resources/js/vendor/pdf.viewer.min.js');
mix.styles('node_modules/pdfjs-dist/web/pdf_viewer.css', 'resources/js/vendor/pdf.viewer.min.css');