javascript - Require in browserify doesn't work variable name -


I'm trying to type with the browser using the variable passed in the function player: Ajax: 'team-overview', path: {name: 'overview', path: 'player episode', URL: 'PlayersOverview' '}}; Var Backbenview = Required (playerops.rout.path); / / Error: Unwanted error: Modules 'Players can not get overview' var backboneview = ('playerAnimals'); // File without any problem is required.

Why am I confused as to why? How can not find the module when there are both strings?

Browser must be capable of statically analyzing all of the statements at construction time , So it can know what needs to be included in the bundle, it is necessary that requirement can be used only with a string in the source code.

Instead of passing the necessary module name, pass only the module:

  var player option = {name: 'players', Ajax : 'Team-overview', Route: {name: 'overview', module: required ('player overview'), url: 'playersoverview'}}; Var Backbenview = Playersopause.rout. Module;  

Even if this browser limit is not limited (for example if you were using directly node.js), it is still a good idea to post later To avoid the necessary module names, the call may be broken if the module was given, it was the relative path to the caller's directory and it was given in the code in the file in another directory.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -