Using webpack with VS2017 - ASP.NET Core 2.0 #161

Closed
opened 2025-08-09 17:15:14 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @Legends on 2/21/2018

The code below works fine in VsCode + webpack (referenced)

Index.ts:

require("./jQueryPlugin-No-Module");
debugger;
$.fn.test();  // fails here

I am using the ProvidePlugin to inject jQuery into this script file.

jQueryPlugin-No-Module.js:

(function ($) {
	$.fn.test = function () {
		console.log("jQuery-Plugin called with options");
	};
})(jQuery);

I have copied the all code from VsCode to VS2017-ASP.NET Core Project and just adapted the paths.. Everything runs perfectly except the plugin above,
I get this error:

image

In index.ts I put a debugger statement. When I run the application it stops there, the plugin $.fn.test has been successfully attached to jQuery. I switch to the Chrome console and execute $.fn.test(); there, works as expected.
I go back to source view and hit F11 to execute the next step and I get the error above.

tsc && webpack -d --env.dev --display-modules --progress --display-error-details --config webpack.config.dev.js

*Originally created by @Legends on 2/21/2018* **The code below works fine in VsCode + webpack** [(referenced)](https://github.com/webpack/webpack/issues/6539#event-1483677627) **Index.ts:** ``` require("./jQueryPlugin-No-Module"); debugger; $.fn.test(); // fails here ``` I am using the ProvidePlugin to inject jQuery into this script file. **jQueryPlugin-No-Module.js:** ``` (function ($) { $.fn.test = function () { console.log("jQuery-Plugin called with options"); }; })(jQuery); ``` **I have copied the all code from VsCode to VS2017-ASP.NET Core Project and just adapted the paths.. Everything runs perfectly except the plugin above, I get this error:** ![image](https://user-images.githubusercontent.com/966368/36454984-7765977e-169e-11e8-8941-363700daae4e.png) In `index.ts` I put a `debugger` statement. When I run the application it stops there, the plugin `$.fn.test` has been successfully attached to jQuery. I switch to the Chrome console and execute `$.fn.test();` there, works as expected. I go back to source view and hit F11 to execute the next step and I get the error above. `tsc && webpack -d --env.dev --display-modules --progress --display-error-details --config webpack.config.dev.js`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#161
No description provided.