remove object spread for node 6 compatibility

This commit is contained in:
Mike Greiling 2018-07-03 01:31:06 -05:00
parent 50ced222cb
commit 8332b52938
No known key found for this signature in database
GPG key ID: 0303DF507FA67596

View file

@ -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);