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
Missing require-context for Webpack #6170
Comments
I think those definitions were added yesterday by this pr #6086 /// <reference path="./webpack.d.ts" />
/// <reference path="./webpack-env.d.ts" />
var context = require.context('./test', true, /.+\.spec\.js?$/);
context.keys().forEach(context); |
I have add in
How do I get these files?
And only |
You can fetch tsd install webpack-env -riso or... should it be combined into single |
I think that can be combined into single file :) Thanks 👍 |
My pleasure! 🎸 |
@Ridermansb Hi, I recently merged webpack-env.* into webpack ,but reverted it again since they should be used in a different context. So if you want to refer require.context, you need to get webpack-env.d.ts independently of webpack.d.ts after the revert will be merged. Thank you |
How can I get webpack-env.d.ts installed into my project via the typings command? |
Could you try this? typings install dt~webpack-env --global |
It works! Thanks! |
Peer dependencies are not automatically installed by typings. You need to install those yourself. Run |
I just tried
|
@jrgleason , I also have the same problem, it show there are two variables(require, module) conflicted in Node.JS and webpack-env. I think we should change the variables' name or not put the variable to global. I think this problem is the same as 8018 and 11324.
|
@zzczzc004 It seems you are also loading types for node, webpack-env types should be loaded instead of node types, not in addition to them. |
@zzczzc004, |
I'm using node require and webpack require, I've installed however, using 'require.context' I still got Any ideas? |
@alexleung @tkqubo by installing the typings definitions solved the problem for me typings install dt~webpack-env --global |
Isn't wepack-env for the version 1.13
Shouldn't |
and in tsconfig.json add it in the
|
Hi @tkqubo .. thanks for your contribution.
Just one feedback:
Missing require-context definition:
Example
tests.webpack.ts
file for testThe text was updated successfully, but these errors were encountered: