Skip to content

Commit

Permalink
fix: Use absolute paths for externals/paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Oct 24, 2020
1 parent c936353 commit fa8fe57
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/rollup/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getBabelInputPlugin, getBabelOutputPlugin } from '@rollup/plugin-babel'
import { getBabelInputConfig, getBabelOutputConfig } from '../babel/config';
import { FeatureFlags, Format } from '../types';
import { EXTENSIONS, EXCLUDE } from '../constants';
import BundleArtifact from '../BundleArtifact';
import type BundleArtifact from '../BundleArtifact';

const sharedPlugins = [resolve({ extensions: EXTENSIONS, preferBuiltins: true }), commonjs()];

Expand All @@ -31,9 +31,11 @@ function getRollupExternalPaths(artifact: BundleArtifact, ext?: string): Record<
artifact.package.artifacts.forEach((art) => {
const bundle = art as BundleArtifact;

// Dont include non-bundle artifacts
// Don't include non-bundle artifacts. We can't use `instanceof`
// because of circular dependencies, boo!
if ('outputName' in bundle) {
paths[`./${bundle.outputName}`] = `./${bundle.outputName}${ext ? `.${ext}` : ''}`;
// All output files are in the same directory, so we can hard-code a relative path
paths[bundle.getInputPath().path()] = `./${bundle.outputName}${ext ? `.${ext}` : ''}`;
}
});

Expand Down

0 comments on commit fa8fe57

Please sign in to comment.