Skip to content

Commit

Permalink
clean unnecessary code (#949)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonBall committed Aug 28, 2020
1 parent e3a79fd commit 843cf9e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
5 changes: 4 additions & 1 deletion snowpack/src/build/build-pipeline.ts
Expand Up @@ -122,7 +122,7 @@ async function runPipelineTransformStep(
try {
for (const destExt of Object.keys(output)) {
const destBuildFile = output[destExt];
const {code} = typeof destBuildFile === 'string' ? {code: destBuildFile} : destBuildFile;
const {code} = destBuildFile;
const fileName = rootFileName + destExt;
const filePath = rootFilePath + destExt;
const debugPath = path.relative(process.cwd(), filePath);
Expand All @@ -141,9 +141,12 @@ async function runPipelineTransformStep(
// if step returned a value, only update code (don’t touch .map)
if (typeof result === 'string') {
output[destExt].code = result;
output[destExt].map = undefined;
} else if (result && typeof result === 'object' && (result as {result: string}).result) {
output[destExt].code = (result as {result: string}).result;
output[destExt].map = undefined;
}

// if source maps disabled, don’t return any
if (!sourceMaps) output[destExt].map = undefined;
}
Expand Down
3 changes: 0 additions & 3 deletions snowpack/src/commands/build.ts
Expand Up @@ -292,7 +292,6 @@ export async function command(commandOptions: CommandOptions) {
async function installDependencies() {
const scannedFiles = Object.values(buildPipelineFiles)
.map((f) => Object.values(f.filesToResolve))
.filter(Boolean)
.reduce((flat, item) => flat.concat(item), []);
const installDest = path.join(buildDirectoryLoc, config.buildOptions.webModulesUrl);
const installResult = await installOptimizedDependencies(scannedFiles, installDest, {
Expand Down Expand Up @@ -478,6 +477,4 @@ export async function command(commandOptions: CommandOptions) {
watcher.on('add', (fileLoc) => onWatchEvent(fileLoc));
watcher.on('change', (fileLoc) => onWatchEvent(fileLoc));
watcher.on('unlink', (fileLoc) => onDeleteEvent(fileLoc));

return new Promise(() => {});
}
4 changes: 0 additions & 4 deletions snowpack/src/commands/install.ts
Expand Up @@ -257,7 +257,6 @@ export async function install(
const installEntrypoints: {[targetName: string]: string} = {};
const assetEntrypoints: {[targetName: string]: string} = {};
const importMap: ImportMap = {imports: {}};
const installTargetsMap: {[targetLoc: string]: InstallTarget[]} = {};
const skipFailures = false;
const autoDetectNamedExports = [
...CJS_PACKAGES_TO_AUTO_DETECT,
Expand All @@ -283,9 +282,6 @@ export async function install(
.forEach(([key]) => {
importMap.imports[key] = `./${targetName}.js`;
});
installTargetsMap[targetLoc] = installTargets.filter(
(t) => installSpecifier === t.specifier,
);
installResults.push([installSpecifier, 'SUCCESS']);
} else if (targetType === 'ASSET') {
assetEntrypoints[targetName] = targetLoc;
Expand Down

1 comment on commit 843cf9e

@vercel
Copy link

@vercel vercel bot commented on 843cf9e Aug 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.