Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
monaco-editor-erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
monaco-editor-erp5
Commits
fe39b696
Commit
fe39b696
authored
6 years ago
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make "public path" configurable at run time
parent
4af71284
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
index.js
index.js
+7
-5
public-path.js
public-path.js
+6
-0
webpack.config.js
webpack.config.js
+1
-1
No files found.
index.js
View file @
fe39b696
import
"
./public-path.js
"
import
*
as
monaco
from
'
monaco-editor
'
;
self
.
MonacoEnvironment
=
{
getWorkerUrl
:
function
(
moduleId
,
label
)
{
if
(
label
===
'
json
'
)
{
return
'
./json.worker.bundle.js
'
;
return
window
.
monacoEditorWebPackResourceBaseUrl
+
'
./json.worker.bundle.js
'
;
}
if
(
label
===
'
css
'
)
{
return
'
./css.worker.bundle.js
'
;
return
window
.
monacoEditorWebPackResourceBaseUrl
+
'
./css.worker.bundle.js
'
;
}
if
(
label
===
'
html
'
)
{
return
'
./html.worker.bundle.js
'
;
return
window
.
monacoEditorWebPackResourceBaseUrl
+
'
./html.worker.bundle.js
'
;
}
if
(
label
===
'
typescript
'
||
label
===
'
javascript
'
)
{
return
'
./ts.worker.bundle.js
'
;
return
window
.
monacoEditorWebPackResourceBaseUrl
+
'
./ts.worker.bundle.js
'
;
}
return
'
./editor.worker.bundle.js
'
;
return
window
.
monacoEditorWebPackResourceBaseUrl
+
'
./editor.worker.bundle.js
'
;
}
}
This diff is collapsed.
Click to expand it.
public-path.js
0 → 100644
View file @
fe39b696
/* In the script on ERP5 we'll set this monacoEditorWebPackResourceBaseUrl to
* portal_url before loading monaco. This way the relative paths are resolved
* properly in ERP5 ( where a <base href=" is set ) and in the ZMI where no
* base is set. */
__webpack_public_path__
=
window
.
monacoEditorWebPackResourceBaseUrl
;
This diff is collapsed.
Click to expand it.
webpack.config.js
View file @
fe39b696
...
...
@@ -14,7 +14,7 @@ module.exports = {
output
:
{
globalObject
:
'
self
'
,
filename
:
'
[name].bundle.js
'
,
path
:
path
.
resolve
(
__dirname
,
'
dist
'
)
path
:
path
.
resolve
(
__dirname
,
'
dist
'
)
,
},
module
:
{
rules
:
[{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment