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

Commit

Permalink
refactor(rollup): check for compiler before preprending ionic core code
Browse files Browse the repository at this point in the history
check for compiler before preprending ionic core code
  • Loading branch information
danbucholtz committed Apr 27, 2017
1 parent bc0fc63 commit 4cfa9bb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/rollup.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { prependIonicGlobal } from './core/ionic-global';
import { basename, join, isAbsolute, normalize, sep } from 'path';

import * as rollupBundler from 'rollup';

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

const bundleOutput = bundle.generate(rollupConfig);

const ionicBundle = prependIonicGlobal(context, basename(rollupConfig.dest), bundleOutput.code);
if (doesCompilerExist(context)) {
const ionicBundle = prependIonicGlobal(context, basename(rollupConfig.dest), bundleOutput.code);

bundleOutput.code = ionicBundle.code;
bundleOutput.map = ionicBundle.map;
bundleOutput.code = ionicBundle.code;
bundleOutput.map = ionicBundle.map;
}

// write the bundle
const promises: Promise<any>[] = [];
Expand Down

0 comments on commit 4cfa9bb

Please sign in to comment.