Open lacolaco opened 8 years ago
Oh interesting. I'll welcome a pr and tests for this absolutely.
Does anyone have a workaround for that?
I also feel that replacing stuff with <string>require(...)
might interfere with tslint
(and tslint-loader
) setting of treating such constructs an error. But not sure about this last piece
@TheLarkInn I also think that given the fact that this project's primary consumers are Webpack users, you should really be recommending to install @types/webpack-env
The correct way to require a string with webpack-env.d.ts is
require<string>(...)
For use webpack APIs (like
require.context()
), webpack-env.d.ts is needed. The definition includes its ownrequire
.https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/webpack/webpack-env.d.ts#L21
It returns a value as
T
. sorequire()
returns the type{}
.idea
Maybe, The loader should replace
templateUrl
to<string>require(...)
.