I am struggling with the requirejs optimizer and non AMD modules

后端 未结 2 999
情深已故
情深已故 2021-02-13 15:19

I am struggling with the requirejs optimizer. This code will work if I just load it in the browser without optimization. If I run the optimizer I get

: ENOENT,          


        
2条回答
  •  别那么骄傲
    2021-02-13 15:41

    See mainConfigFile. This was put into place so you do not have to copy your require configuration into runtime/optimize-time files, keeping your build DRY:

    //By default all the configuration for optimization happens from the command
    //line or by properties in the config file, and configuration that was
    //passed to requirejs as part of the app's runtime "main" JS file is *not*
    //considered. However, if you prefer the "main" JS file configuration
    //to be read for the build so that you do not have to duplicate the values
    //in a separate configuration, set this property to the location of that
    //main JS file. The first requirejs({}), require({}), requirejs.config({}),
    //or require.config({}) call found in that file will be used.
    mainConfigFile: '../some/path/to/main.js',
    

提交回复
热议问题