0

I have below in configuration for require

require.config({
    baseUrl: "",
    waitSeconds: 0,
    // alias libraries paths
    paths: {
        'application-configuration': 'Scripts/App/application-configuration',
        'sessionService': 'Scripts/App/Services/ sessionServices',
        'ajaxService': 'Scripts/App/Services/ajaxServices',
        'alertsService': 'Scripts/App/Services/alertsServices',

The list is huge. These are unnamed modules. I need to minify and bundle-up in one single request.

The suggestion mentioned here says to strictly use the named modules. Is there a way for unnamed modules/scenario like above?

Note: I understand its a good idea to name your modules, but the files are large in number I want to avoid naming all of them at this point.

Community
  • 1
  • 1
Deepak Agarwal
  • 458
  • 1
  • 4
  • 18

1 Answers1

0

It is okay to have modules using an anonymous define call be used in the input of your bundling process. You don't have to open each and every file and add a module name in order to bundle them.

However, the bundler will have to turn all the anonymous calls into named calls. There's no way around it. This is automatic though, so it should not be a big deal.

I understand its a good idea to name your modules.

You should let your bundler do the naming. Putting the names in yourself is a bad idea.

Louis
  • 146,715
  • 28
  • 274
  • 320