Skip to content

fix(@ngtools/webpack): continue past invalid imports #5028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 1, 2017

Conversation

FrozenPandaz
Copy link
Contributor

Small change to continue instead of bail.

This happens when for some reason Typescript cant locate a module in an import statement.

This WILL be necessary for supporting fs for platform-server

Example:
main.ts

import * as fs from 'fs'; // Yeah this will probably never be the actual use case but to have it is good to be able to skip over this
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppBrowserModule } from './app/app.browser.module';
import { environment } from './environments/environment';

if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppBrowserModule);

To test, import this before your MainModule

import * as fs from 'fs';

@FrozenPandaz
Copy link
Contributor Author

cc @hansl This should be quick

Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but note that your example is faulty. If you have proper typings it will resolve correctly.

@hansl hansl merged commit dbd71b7 into angular:master Mar 1, 2017
@leehung-net
Copy link

Your example is fault. How to can me using require('fs')?

asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this pull request Apr 12, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants