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

Commit

Permalink
fix(deeplinks): provide deep-links config to webpack as needed vs via…
Browse files Browse the repository at this point in the history
… the constructor

provide deep-links config to webpack as needed vs via the constructor
  • Loading branch information
danbucholtz committed Feb 13, 2017
1 parent 5b7243d commit a735e96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/webpack/ionic-environment-plugin.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { getParsedDeepLinkConfig } from '../util/helpers';
import { BuildContext, HydratedDeepLinkConfigEntry } from '../util/interfaces';
import { Logger } from '../logger/logger';
import { getInstance } from '../util/hybrid-file-system-factory';
import { createResolveDependenciesFromContextMap } from './util';

export class IonicEnvironmentPlugin {
constructor(private context: BuildContext, private parsedDeepLinkConfigs: HydratedDeepLinkConfigEntry[]) {
constructor(private context: BuildContext) {
}

apply(compiler: any) {

compiler.plugin('context-module-factory', (contextModuleFactory: any) => {
const webpackDeepLinkModuleDictionary = convertDeepLinkConfigToWebpackFormat(this.parsedDeepLinkConfigs);
const deepLinkConfig = getParsedDeepLinkConfig();
const webpackDeepLinkModuleDictionary = convertDeepLinkConfigToWebpackFormat(deepLinkConfig);
contextModuleFactory.plugin('after-resolve', (result: any, callback: Function) => {
if (!result) {
return callback();
Expand Down
4 changes: 2 additions & 2 deletions src/webpack/ionic-webpack-factory.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { getIonicDependenciesCommonChunksPlugin, getNonIonicDependenciesCommonChunksPlugin } from './common-chunks-plugins';
import { IonicEnvironmentPlugin } from './ionic-environment-plugin';
import { provideCorrectSourcePath } from './source-mapper';
import { getContext, getParsedDeepLinkConfig } from '../util/helpers';
import { getContext } from '../util/helpers';

export function getIonicEnvironmentPlugin() {
const context = getContext();
return new IonicEnvironmentPlugin(context, getParsedDeepLinkConfig());
return new IonicEnvironmentPlugin(context);
}

export function getSourceMapperFunction(): Function {
Expand Down

0 comments on commit a735e96

Please sign in to comment.