Navigation Menu

Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Fixes #26
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Aug 10, 2018
1 parent 02fcbd5 commit e605ab2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 4 additions & 2 deletions features.js
Expand Up @@ -119,9 +119,11 @@ module.exports = {
entry: 'vs/editor/standalone/browser/quickOpen/quickOutline',
worker: undefined,
},
// TODO: here
referenceSearch: {
entry: 'vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch',
entry: [
'vs/editor/contrib/referenceSearch/referenceSearch',
'vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch',
],
worker: undefined,
},
rename: {
Expand Down
13 changes: 11 additions & 2 deletions index.js
Expand Up @@ -84,8 +84,8 @@ function getPublicPath(compiler) {

function createLoaderRules(languages, features, workers, outputPath, publicPath) {
if (!languages.length && !features.length) { return []; }
const languagePaths = languages.map(({ entry }) => entry).filter(Boolean);
const featurePaths = features.map(({ entry }) => entry).filter(Boolean);
const languagePaths = flatArr(languages.map(({ entry }) => entry).filter(Boolean));
const featurePaths = flatArr(features.map(({ entry }) => entry).filter(Boolean));
const workerPaths = fromPairs(workers.map(({ label, output }) => [label, path.join(outputPath, output)]));

const globals = {
Expand Down Expand Up @@ -162,6 +162,15 @@ function flatMap(items, iteratee) {
return items.map(iteratee).reduce((acc, item) => [].concat(acc).concat(item), []);
}

function flatArr(items) {
return items.reduce((acc, item) => {
if (Array.isArray(item)) {
return [].concat(acc).concat(item);
}
return [].concat(acc).concat([item]);
}, []);
}

function toPairs(object) {
return Object.keys(object).map((key) => [key, object[key]]);
}
Expand Down

0 comments on commit e605ab2

Please sign in to comment.