Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

107
Views
ASP.NET Core - How to create a Javascript Module

I have an ASP.NET Core 5 MVC application (no SPA framework). For my Javascript-Files I want to use a single "namespace".

For example I have two JS files:

wwwroot/js/foo.js

function foo(){
...something
}

wwwroot/js/bar.js

function bar(){
...something
}

I want both to be bundled into a single file site.js and accessible with in a single namespace:

myApp.foo();
myApp.bar();

I'm searching for something like you get with the use of IIFE. But I don't know how I can load the javascript from multiple js-files into one IIFE:

function(root, factory) {
  root.myApp = factory()
}(this, (function() {
  'use strict';
  var myApp = {};

  myApp.foo = ... foo.js;
  myApp.bar = ... bar.js;

  return myApp;
})));
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!