thiagobustamante / typescript-ioc

A Lightweight annotation-based dependency injection container for typescript.
MIT License
526 stars 64 forks source link

ES5 / ES6 dynamic require in index.js doesn't work with browserify #14

Closed lakemalcom closed 6 years ago

lakemalcom commented 7 years ago

I end up with: Uncaught Error: Cannot find module './es5'

If I change the output from: module.exports = require(useES6 ? './es6' : './es5'); to: module.exports = require('./es5');

Then everything works fine.

dpanelli commented 6 years ago

Is there a release planned with this?

thiagobustamante commented 6 years ago

Please, refer to this section in the documentation.

When using with browserify, webpack etc, you must import the library as:

import {AutoWired, Inject} from "typescript-ioc/es5";

or, if you are using es6 as output:

import {AutoWired, Inject} from "typescript-ioc/es6";