mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 19:42:56 +01:00
remove object spread for node 6 compatibility
This commit is contained in:
parent
50ced222cb
commit
8332b52938
1 changed files with 3 additions and 3 deletions
6
index.js
6
index.js
|
|
@ -37,10 +37,10 @@ function resolveMonacoPath(filePath) {
|
||||||
|
|
||||||
const languagesById = fromPairs(
|
const languagesById = fromPairs(
|
||||||
flatMap(toPairs(LANGUAGES), ([id, language]) =>
|
flatMap(toPairs(LANGUAGES), ([id, language]) =>
|
||||||
[id, ...(language.alias || [])].map((label) => [label, { label, ...language }])
|
[id, ...(language.alias || [])].map((label) => [label, Object.assign({ label }, language )])
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
const featuresById = mapValues(FEATURES, (feature, key) => ({ label: key, ...feature }))
|
const featuresById = mapValues(FEATURES, (feature, key) => (Object.assign({ label: key }, feature )));
|
||||||
|
|
||||||
class MonacoWebpackPlugin {
|
class MonacoWebpackPlugin {
|
||||||
constructor(options = {}) {
|
constructor(options = {}) {
|
||||||
|
|
@ -59,7 +59,7 @@ class MonacoWebpackPlugin {
|
||||||
const publicPath = getPublicPath(compiler);
|
const publicPath = getPublicPath(compiler);
|
||||||
const modules = [EDITOR_MODULE, ...languages, ...features];
|
const modules = [EDITOR_MODULE, ...languages, ...features];
|
||||||
const workers = modules.map(
|
const workers = modules.map(
|
||||||
({ label, alias, worker }) => worker && ({ label, alias, ...worker })
|
({ label, alias, worker }) => worker && Object.assign({ label, alias }, worker)
|
||||||
).filter(Boolean);
|
).filter(Boolean);
|
||||||
const rules = createLoaderRules(languages, features, workers, output, publicPath);
|
const rules = createLoaderRules(languages, features, workers, output, publicPath);
|
||||||
const plugins = createPlugins(workers, output);
|
const plugins = createPlugins(workers, output);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue