Skip to content
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

Error ts-md5 library #604

Closed
spideodev opened this issue May 2, 2016 · 2 comments
Closed

Error ts-md5 library #604

spideodev opened this issue May 2, 2016 · 2 comments

Comments

@spideodev
Copy link

spideodev commented May 2, 2016

Hi team,

$ node -v
v4.4.3
$ npm -v
3.8.6

I'm trying to import ts-md5 library with the last version of angular-cli (0.34).

So, I'm following the wiki page https://github.com/angular/angular-cli/wiki/3rd-party-libs

My angular-cli-build.js file:

module.exports = function (defaults) {
    var app = new Angular2App(defaults, {
        vendorNpmFiles: [
            'ts-md5/dist/md5.js'
        ]
    });
    return app.toTree();
};

But when I built my project, the library was not imported to the dist folder.

Next, in the system-config.ts file:

export const config:any = {
    packages: Object.assign({
        // Add your custom SystemJS packages here.
    }, createPackageConfig(barrels)),
    map: {
        'md5': 'vendor/ts-md5/dist/md5.js'
    }
};

And, the module is not found in component file:

/src/client/app/components/login/login.component.ts (4, 19): Cannot find module 'md5'.

Also this doesn't work anymore: #327
Do you have any idea please ?

@spideodev
Copy link
Author

It works with this config:

export const config: any = {
  packages: Object.assign({
    // Add your custom SystemJS packages here.
    'ts-md5': { 
      map: { 
        './md5': './dist/md5.js'
      }
    }
  }, createPackageConfig(barrels)),
  map: {
    'ts-md5': 'vendor/ts-md5'
  }
};

Thanks @altrim

@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 5, 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

No branches or pull requests

1 participant