forked from ProcessMaker/processmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
141 lines (128 loc) · 6.06 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
const mix = require('laravel-mix');
const path = require("path");
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.webpackConfig({
plugins: [
],
externals: [
'monaco-editor',
'SharedComponents'
],
resolve: {
symlinks: false,
alias: {
'vue-monaco': path.resolve(__dirname, 'resources/js/vue-monaco-amd.js')
},
}
});
mix.options({
terser: {
parallel: true
}
});
mix.extract([
"vue",
"vue-router",
"jquery",
"bootstrap-vue",
"axios",
"popper.js",
"lodash",
"bootstrap",
"jointjs",
"luxon",
"bpmn-moddle",
"@fortawesome/fontawesome-free",
"@fortawesome/fontawesome-svg-core",
"@fortawesome/free-brands-svg-icons",
"@fortawesome/free-solid-svg-icons",
"@fortawesome/vue-fontawesome"
])
.copy("resources/img/*", "public/img")
.copy("node_modules/snapsvg/dist/snap.svg.js", "public/js")
.copy("resources/js/components/CustomActions.vue", "public/js")
.copy("resources/js/components/DetailRow.vue", "public/js")
// .copy("resources/fonts/Open_Sans/", "public/fonts")
.copy("resources/js/components/FilterBar.vue", "public/js")
.copy("resources/js/timeout.js", "public/js")
// Copy files necessary for images for the designer/modeler to it's own img directory
.copy("node_modules/@processmaker/modeler/dist/img", "public/js/processes/modeler/img")
.copy("node_modules/@processmaker/vue-form-elements/dist", "public/js")
.copy("node_modules/bpmn-font/dist", "public/css/bpmn-symbols");
mix.js("resources/js/app-layout.js", "public/js")
.js("resources/js/processes/modeler/index.js", "public/js/processes/modeler")
.js("resources/js/processes/modeler/initialLoad.js", "public/js/processes/modeler")
.js("resources/js/admin/auth/passwords/change.js", "public/js/admin/auth/passwords/change.js")
.js("resources/js/admin/settings/index.js", "public/js/admin/settings")
.js("resources/js/admin/settings/ldaplogs.js", "public/js/admin/settings")
.js("resources/js/admin/users/index.js", "public/js/admin/users")
.js("resources/js/admin/users/edit.js", "public/js/admin/users/edit.js")
.js("resources/js/admin/groups/index.js", "public/js/admin/groups")
.js("resources/js/admin/groups/edit.js", "public/js/admin/groups/edit.js")
.js("resources/js/admin/auth-clients/index.js", "public/js/admin/auth-clients/index.js")
// .js("resources/js/admin/queues/index.js", "public/js/admin/queues")
.js("resources/js/admin/profile/edit.js", "public/js/admin/profile/edit.js")
.js("resources/js/admin/cssOverride/edit.js", "public/js/admin/cssOverride/edit.js")
.js("resources/js/admin/script-executors/index.js", "public/js/admin/script-executors/index.js")
.js("resources/js/processes/index.js", "public/js/processes")
.js("resources/js/processes/edit.js", "public/js/processes")
.js("resources/js/processes/archived.js", "public/js/processes")
.js("resources/js/processes/categories/index.js", "public/js/processes/categories")
.js("resources/js/processes/scripts/index.js", "public/js/processes/scripts")
.js("resources/js/processes/scripts/edit.js", "public/js/processes/scripts")
.js("resources/js/processes/scripts/editConfig.js", "public/js/processes/scripts")
.js("resources/js/processes/export/index.js", "public/js/processes/export")
.js("resources/js/processes/environment-variables/index.js", "public/js/processes/environment-variables")
.js("resources/js/processes/import/index.js", "public/js/processes/import")
.js("resources/js/processes/screens/index.js", "public/js/processes/screens")
.js("resources/js/processes/screens/edit.js", "public/js/processes/screens")
.js("resources/js/processes/signals/index.js", "public/js/processes/signals")
.js("resources/js/processes/signals/edit.js", "public/js/processes/signals")
.js("resources/js/processes/screen-builder/main.js", "public/js/processes/screen-builder")
.js("resources/js/processes/screen-builder/typeForm.js", "public/js/processes/screen-builder")
.js("resources/js/processes/screen-builder/typeDisplay.js", "public/js/processes/screen-builder")
.js("resources/js/leave-warning.js", "public/js")
.js("resources/js/requests/index.js", "public/js/requests")
.js("resources/js/requests/show.js", "public/js/requests")
.js("resources/js/requests/preview.js", "public/js/requests")
.js("resources/js/tasks/index.js", "public/js/tasks/index.js")
.js("resources/js/tasks/show.js", "public/js/tasks/show.js")
.js("resources/js/notifications/index.js", "public/js/notifications/index.js")
// Note, that this should go last for the extract to properly put the manifest and vendor in the right location
// See: https://github.com/JeffreyWay/laravel-mix/issues/1118
.js("resources/js/app.js", "public/js");
// Monaco AMD modules. Copy only the files we need to make the build faster.
const monacoSource = 'node_modules/monaco-editor/min/vs/';
const monacoDestination = 'public/vendor/monaco-editor/min/vs/';
const monacoLanguages = ['php', 'css', 'lua', 'javascript', 'csharp', 'java', 'python', 'r', 'html', 'xml', 'typescript'];
const monacoFiles = [
'loader.js',
'editor/editor.main.js',
'editor/editor.main.css',
'editor/editor.main.nls.js',
'base/browser/ui/codicons/codicon/codicon.ttf',
'base/worker/workerMain.js',
'base/common/worker/simpleWorker.nls.js',
];
monacoFiles.forEach(file => {
mix.copy(monacoSource + file, monacoDestination + file);
});
monacoLanguages.forEach(lang => {
const path = `basic-languages/${lang}/${lang}.js`;
mix.copy(monacoSource + path, monacoDestination + path);
});
mix.copyDirectory(monacoSource + 'language', monacoDestination + 'language');
mix.sass("resources/sass/sidebar/sidebar.scss", "public/css")
.sass("resources/sass/app.scss", "public/css")
.sass("resources/sass/admin/queues.scss", "public/css/admin")
.version();
mix.vue({ version: 2 });