Open GeorgeS2019 opened 4 years ago
I'm not sure you can use module exporting inside the javascript objects this is wrong for isolated JS modules in Blazor
window.dotNetToJsBrowserify = {
learnBrowserify: module.exports = function (message) {
var unique = require('uniq');
@simutaroman Thanks for replying. Can u suggest where I can go next to get Browserify, with require statements linking to NodeModules => To work with Blazor JS Isolation.
If U think in your view, the current Blazor JS Isolation will not able to handle that, Please share your view.
FYI => I found this, the plan to bridge the CSJ and ESM gap
I can't understand what is your goal. just use the browserify (or webpack or any other tool) to compile all your JS code into a single ESM compatible file and use it. If you need separate files for your Blazor components (that is called JS isolation in Blazor) just set up your configuration properly and compile different sources into corresponded js files for your Blazor components
@simutaroman Thanks for positive feedback. I am new to what you have suggested. Now I will attempt to try that. I am sure my use case is relevant to people who are trying to make existing JavaScript libraries to work with Blazor
This works!!!
Bundle.js
HOWEVER, this fail to find dotNetToJsBrowserify.learnBrowserify
Still new to this, any suggestion how to make it right?