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

Commit 4cfa9bb

Browse files
committed
refactor(rollup): check for compiler before preprending ionic core code
check for compiler before preprending ionic core code
1 parent bc0fc63 commit 4cfa9bb

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/rollup.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import { prependIonicGlobal } from './core/ionic-global';
21
import { basename, join, isAbsolute, normalize, sep } from 'path';
2+
33
import * as rollupBundler from 'rollup';
44

5+
import { prependIonicGlobal } from './core/ionic-global';
6+
import { doesCompilerExist } from './core/bundle-components';
57
import { Logger } from './logger/logger';
68
import { ionicRollupResolverPlugin, PLUGIN_NAME } from './rollup/ionic-rollup-resolver-plugin';
79
import { fillConfigDefaults, getUserConfigFile, replacePathVars } from './util/config';
@@ -91,10 +93,12 @@ export function rollupWorker(context: BuildContext, configFile: string): Promise
9193

9294
const bundleOutput = bundle.generate(rollupConfig);
9395

94-
const ionicBundle = prependIonicGlobal(context, basename(rollupConfig.dest), bundleOutput.code);
96+
if (doesCompilerExist(context)) {
97+
const ionicBundle = prependIonicGlobal(context, basename(rollupConfig.dest), bundleOutput.code);
9598

96-
bundleOutput.code = ionicBundle.code;
97-
bundleOutput.map = ionicBundle.map;
99+
bundleOutput.code = ionicBundle.code;
100+
bundleOutput.map = ionicBundle.map;
101+
}
98102

99103
// write the bundle
100104
const promises: Promise<any>[] = [];

0 commit comments

Comments
 (0)