Skip to content

Remove "path" dependency from library #50

@pfeigl

Description

@pfeigl

Please remove the path dependency from the library. It's a node function and thus not available in browsers by default.

Current builds of Angular 6 won't work because path cannot be resolved.
Also examples on Stackblitz fail, see i.e.: https://stackblitz.com/edit/angular-6-mime-types

I tried installing the path package from npm (which is super outdated) but this also fails because path internally depends on process which is also not available.

Here's the actual implementation: https://github.com/nodejs/node/blob/master/lib/path.js#L836
We could either migrate this into the project or take a much simpler approach using a very basic regex or split algo.
Here's some very good information on it: https://stackoverflow.com/questions/190852/how-can-i-get-file-extensions-with-javascript/1203361#1203361

I'd also happily provide a PR if help is wanted.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions