Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 350a288

Browse files
committed
fix(rollup): removing rollup metadata prefix for paths
removing rollup metadata prefix for paths
1 parent 0685c0b commit 350a288

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/rollup.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { BuildContext, BuildState, TaskInfo } from './util/interfaces';
22
import { BuildError, Logger } from './util/logger';
33
import { fillConfigDefaults, generateContext, getUserConfigFile, replacePathVars } from './util/config';
44
import { ionCompiler } from './plugins/ion-compiler';
5-
import { join, isAbsolute, normalize } from 'path';
5+
import { join, isAbsolute, normalize, sep } from 'path';
66
import * as rollupBundler from 'rollup';
77

88

@@ -82,7 +82,14 @@ export function rollupWorker(context: BuildContext, configFile: string): Promise
8282

8383
// set the module files used in this bundle
8484
// this reference can be used elsewhere in the build (sass)
85-
context.moduleFiles = bundle.modules.map((m) => m.id);
85+
context.moduleFiles = bundle.modules.map((m) => {
86+
// sometimes, Rollup appends weird prefixes to the path like commonjs:proxy
87+
const index = m.id.indexOf(sep);
88+
if (index >= 0) {
89+
return m.id.substring(index);
90+
}
91+
return m.id;
92+
});
8693

8794
// cache our bundle for later use
8895
if (context.isWatch) {

0 commit comments

Comments
 (0)