Using Webpack in ASP.net webforms application: Namespaces, Modules, Typings, and Compiling
up vote
0
down vote
favorite
I am trying to introduce webpack in an ASP.net web forms application using visual studio.
Having turned off the VS TypeScript compiler using this property group:
<PropertyGroup>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
</PropertyGroup>
I have come across countless issues in order to get this working, and I still haven't.
First of all the compiler and IDE no longer recognise the typings for jQuery and other libraries.
I have read about a few solutions which have suggested using the "include", "typeRoot" and "types" properties in the tsconfig file.
When I specify values for "typeRoot" and "types" like so:
"typeRoots": [
"./node_modules/@types",
"./Scripts/typings"
],
"types": [
"node",
"jquery",
"jqueryui",
Still when I run the build command the compiler throws a bunch of errors:
TS2304: Cannot find name '$'.
TS2304: Cannot find name 'jQuery'.
The types and libraries all do exist in the application. Before, Visual Studio recognised these automatically without having to specify any sort of configuration like above.
Now on introducing webpack and NPM in the project, every ts file has a bunch of errors and all TypeScript namespaces and modules also error.
Why is this the case?
In order to resolve this, I'd have to add a reference path in every file like so for typings and any namespace or module.
/// <reference path="./typings/jquery/jquery.d.ts" />
/// <reference path="./Modules/MyModule.ts" />
I have tried all sorts to resolve this issues, even adding a _resource.ts file didn't work as the IDE still did not recognise this file - in the root directory.
How can I get the IDE to recognise the types, namespaces, and modules without manually adding in each and every file and get the compiler to compile successfully?
Even when I add these to "include" property in the tsconfig, the IDE still complains with the error cannot find....
asp.net typescript npm webpack webforms
add a comment |
up vote
0
down vote
favorite
I am trying to introduce webpack in an ASP.net web forms application using visual studio.
Having turned off the VS TypeScript compiler using this property group:
<PropertyGroup>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
</PropertyGroup>
I have come across countless issues in order to get this working, and I still haven't.
First of all the compiler and IDE no longer recognise the typings for jQuery and other libraries.
I have read about a few solutions which have suggested using the "include", "typeRoot" and "types" properties in the tsconfig file.
When I specify values for "typeRoot" and "types" like so:
"typeRoots": [
"./node_modules/@types",
"./Scripts/typings"
],
"types": [
"node",
"jquery",
"jqueryui",
Still when I run the build command the compiler throws a bunch of errors:
TS2304: Cannot find name '$'.
TS2304: Cannot find name 'jQuery'.
The types and libraries all do exist in the application. Before, Visual Studio recognised these automatically without having to specify any sort of configuration like above.
Now on introducing webpack and NPM in the project, every ts file has a bunch of errors and all TypeScript namespaces and modules also error.
Why is this the case?
In order to resolve this, I'd have to add a reference path in every file like so for typings and any namespace or module.
/// <reference path="./typings/jquery/jquery.d.ts" />
/// <reference path="./Modules/MyModule.ts" />
I have tried all sorts to resolve this issues, even adding a _resource.ts file didn't work as the IDE still did not recognise this file - in the root directory.
How can I get the IDE to recognise the types, namespaces, and modules without manually adding in each and every file and get the compiler to compile successfully?
Even when I add these to "include" property in the tsconfig, the IDE still complains with the error cannot find....
asp.net typescript npm webpack webforms
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to introduce webpack in an ASP.net web forms application using visual studio.
Having turned off the VS TypeScript compiler using this property group:
<PropertyGroup>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
</PropertyGroup>
I have come across countless issues in order to get this working, and I still haven't.
First of all the compiler and IDE no longer recognise the typings for jQuery and other libraries.
I have read about a few solutions which have suggested using the "include", "typeRoot" and "types" properties in the tsconfig file.
When I specify values for "typeRoot" and "types" like so:
"typeRoots": [
"./node_modules/@types",
"./Scripts/typings"
],
"types": [
"node",
"jquery",
"jqueryui",
Still when I run the build command the compiler throws a bunch of errors:
TS2304: Cannot find name '$'.
TS2304: Cannot find name 'jQuery'.
The types and libraries all do exist in the application. Before, Visual Studio recognised these automatically without having to specify any sort of configuration like above.
Now on introducing webpack and NPM in the project, every ts file has a bunch of errors and all TypeScript namespaces and modules also error.
Why is this the case?
In order to resolve this, I'd have to add a reference path in every file like so for typings and any namespace or module.
/// <reference path="./typings/jquery/jquery.d.ts" />
/// <reference path="./Modules/MyModule.ts" />
I have tried all sorts to resolve this issues, even adding a _resource.ts file didn't work as the IDE still did not recognise this file - in the root directory.
How can I get the IDE to recognise the types, namespaces, and modules without manually adding in each and every file and get the compiler to compile successfully?
Even when I add these to "include" property in the tsconfig, the IDE still complains with the error cannot find....
asp.net typescript npm webpack webforms
I am trying to introduce webpack in an ASP.net web forms application using visual studio.
Having turned off the VS TypeScript compiler using this property group:
<PropertyGroup>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
</PropertyGroup>
I have come across countless issues in order to get this working, and I still haven't.
First of all the compiler and IDE no longer recognise the typings for jQuery and other libraries.
I have read about a few solutions which have suggested using the "include", "typeRoot" and "types" properties in the tsconfig file.
When I specify values for "typeRoot" and "types" like so:
"typeRoots": [
"./node_modules/@types",
"./Scripts/typings"
],
"types": [
"node",
"jquery",
"jqueryui",
Still when I run the build command the compiler throws a bunch of errors:
TS2304: Cannot find name '$'.
TS2304: Cannot find name 'jQuery'.
The types and libraries all do exist in the application. Before, Visual Studio recognised these automatically without having to specify any sort of configuration like above.
Now on introducing webpack and NPM in the project, every ts file has a bunch of errors and all TypeScript namespaces and modules also error.
Why is this the case?
In order to resolve this, I'd have to add a reference path in every file like so for typings and any namespace or module.
/// <reference path="./typings/jquery/jquery.d.ts" />
/// <reference path="./Modules/MyModule.ts" />
I have tried all sorts to resolve this issues, even adding a _resource.ts file didn't work as the IDE still did not recognise this file - in the root directory.
How can I get the IDE to recognise the types, namespaces, and modules without manually adding in each and every file and get the compiler to compile successfully?
Even when I add these to "include" property in the tsconfig, the IDE still complains with the error cannot find....
asp.net typescript npm webpack webforms
asp.net typescript npm webpack webforms
edited Nov 11 at 13:07
Zoe
10.7k73575
10.7k73575
asked Nov 11 at 12:28
Chief
4819
4819
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53248765%2fusing-webpack-in-asp-net-webforms-application-namespaces-modules-typings-and%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown