-
-
Notifications
You must be signed in to change notification settings - Fork 106
/
webpack.mix.js
130 lines (115 loc) · 5.58 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
const mix = require('laravel-mix');
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const IgnoreEmitPlugin = require('ignore-emit-webpack-plugin');
/*
|--------------------------------------------------------------------------
| 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.
|
*/
// Pre Compile NOJ JS Supporting Libraries - app.temp.js
mix.ts('resources/ts/app.ts', 'public/static/js/build/app.temp.js');
// Pre Compile NOJ CSS Supporting Libraries - app.temp.css
mix.sass('resources/sass/app.scss', 'public/static/css/build/app.temp.css');
// Pre Compile NOJ Admin Portal JS Supporting Libraries - app.admin.temp.js
mix.ts('resources/ts/admin.ts', 'public/static/js/build/app.admin.temp.js');
// Pre Compile NOJ Admin Portal CSS Supporting Libraries - app.admin.temp.css
mix.sass('resources/sass/admin.scss', 'public/static/css/build/app.admin.temp.css');
// Compile NOJ Admin Portal CSS Libraries Bundle - app.admin.css
mix.styles([
'public/static/css/build/app.admin.temp.css',
'node_modules/simplemde/dist/simplemde.min.css',
'node_modules/codemirror/lib/codemirror.css',
'node_modules/codemirror/addon/hint/show-hint.css',
'node_modules/highlight.js/styles/vs.css',
'node_modules/github-markdown-css/github-markdown-light.css',
], 'public/static/css/build/app.admin.css');
// Compile NOJ Admin Portal JS Libraries Bundle - app.admin.js
mix.scripts([
'public/static/js/build/app.admin.temp.js',
'node_modules/simplemde/dist/simplemde.min.js',
'node_modules/marked/marked.min.js',
'node_modules/codemirror/lib/codemirror.js',
'node_modules/codemirror/addon/edit/matchbrackets.js',
'node_modules/codemirror/addon/hint/show-hint.js',
'node_modules/codemirror/mode/clike/clike.js',
], 'public/static/js/build/app.admin.js');
// Compile NOJ JS Libraries Bundle - app.js
mix.scripts([
'public/static/js/build/app.temp.js',
'node_modules/bootstrap-material-design/dist/js/bootstrap-material-design.min.js',
'node_modules/pdfobject/pdfobject.min.js',
'node_modules/jquery-datetimepicker/build/jquery.datetimepicker.full.min.js',
'node_modules/parazoom/dist/parazoom.min.js',
'node_modules/chart.js/dist/Chart.bundle.min.js',
'node_modules/simplemde/dist/simplemde.min.js',
'node_modules/marked/marked.min.js',
'node_modules/clipboard/dist/clipboard.min.js',
], 'public/static/js/build/app.js');
// Compile NOJ PDF Compiler Libraries Bundle - paged.polyfill.js
mix.scripts([
'node_modules/pagedjs/dist/paged.polyfill.js',
], 'public/static/js/build/paged.polyfill.js');
// Compile NOJ CSS Libraries Bundle - app.css
mix.styles([
'public/static/css/build/app.temp.css',
'node_modules/bootstrap-material-design/dist/css/bootstrap-material-design.min.css',
'node_modules/animate.css/animate.min.css',
'resources/css/main.css',
'node_modules/jquery-datetimepicker/build/jquery.datetimepicker.min.css',
'node_modules/simplemde/dist/simplemde.min.css',
'node_modules/github-markdown-css/github-markdown-light.css',
], 'public/static/css/build/app.css');
// Compile NOJ Editor - app.editor.js
mix.ts('resources/ts/monaco-editor/monaco.ts', 'public/static/js/build/app.editor.js');
if (mix.inProduction()) {
mix.version();
}
mix.disableNotifications();
mix.options({
postCss: [
require('autoprefixer')
],
fileLoaderDirs: {
images: 'static/img',
fonts: 'static/fonts'
},
});
mix.webpackConfig({
devtool: false,
entry: {
// Package each language's worker and give these filenames in `getWorkerUrl`
// 'static/js/build/worker/editor': 'monaco-editor/esm/vs/editor/editor.worker.js',
// 'static/js/build/worker/json': 'monaco-editor/esm/vs/language/json/json.worker',
// 'static/js/build/worker/css': 'monaco-editor/esm/vs/language/css/css.worker',
// 'static/js/build/worker/html': 'monaco-editor/esm/vs/language/html/html.worker',
// 'static/js/build/worker/ts': 'monaco-editor/esm/vs/language/typescript/ts.worker',
},
module: {
rules: [
{
test: /\.wasm$/,
use: ['wasm-loader'],
}
],
},
stats: {
warnings: false,
},
// As suggested on:
// https://github.com/NeekSandhu/monaco-editor-textmate/blame/45e137e5604504bcf744ef86215becbbb1482384/README.md#L58-L59
//
// Use the MonacoWebpackPlugin to disable all built-in tokenizers/languages.
plugins: [
new MonacoWebpackPlugin({
filename: 'static/js/build/worker/[name].js',
publicPath: '/',
languages: [],
features: ['accessibilityHelp', 'anchorSelect', 'bracketMatching', 'caretOperations', 'clipboard', 'codeAction', 'codelens', 'colorPicker', 'comment', 'contextmenu', 'coreCommands', 'cursorUndo', 'dnd', 'documentSymbols', 'find', 'folding', 'fontZoom', 'format', 'gotoError', 'gotoLine', 'gotoSymbol', 'hover', 'iPadShowKeyboard', 'inPlaceReplace', 'indentation', 'inlayHints', 'inlineCompletions', 'inspectTokens', 'linesOperations', 'linkedEditing', 'links', 'multicursor', 'parameterHints', 'quickCommand', 'quickHelp', 'quickOutline', 'referenceSearch', 'rename', 'smartSelect', 'snippets', 'suggest', 'toggleTabFocusMode', 'transpose', 'unusualLineTerminators', 'viewportSemanticTokens', 'wordHighlighter', 'wordOperations', 'wordPartOperations']
})
],
});