grunt-requirejs icon indicating copy to clipboard operation
grunt-requirejs copied to clipboard

mainConfigFile ignored

Open SerzN1 opened this issue 10 years ago • 5 comments

all from your example

requirejs: {
  compile: {
    options: {
        baseUrl: "/js/",
        out: "/js/dist/App.js",
        mainConfigFile: "/js/build.config.js"
    }
  }
}



Running "requirejs:compile" (requirejs) task
{ [Error: Error: Missing either a "name", "include" or "modules" option
    at Function.build.createConfig (C:\RKassa\Afisha.Tickets\node_modules\grunt-
contrib-requirejs\node_modules\requirejs\bin\r.js:26800:19)
]
  originalError: [Error: Missing either a "name", "include" or "modules" option]
 }


build.config.js
...
include: [ 
        'almond'
        , 'App'
        , 'section/schedule'
        , 'section/forms'
        , 'section/showroom'
        , 'stub/maps'
        , 'stub/city_select'
        , 'stub/search'
        , 'stub/slider'
        , 'hallplan'
    ] 
...

config ignored?

SerzN1 avatar Apr 25 '14 08:04 SerzN1

if i copy all from config file to grunt task - it's working!

SerzN1 avatar Apr 25 '14 08:04 SerzN1

Normally, this should work :/ Could you post the complete contents of your build.config.js please, I have a feeling in my gut, that the error could be in there. Also, it would be interesting to see if the default r.js optimiser is able to do the build (without grunt), could you please try that?

Thanks.

asciidisco avatar Apr 25 '14 19:04 asciidisco

Hi. Yes, r.js build success.

biuld.config.js

({
    baseUrl : "../js",
    paths: {
        'App'                   : 'App',
        'requireLib'            : 'vendor/require',
        'almond'                : 'vendor/almond',
        'curl'                  : 'vendor/curl',
        'window'                : 'stub/window',
        'jquery'                : 'vendor/jquery-1.10.2.min',
        //'jquery'              : 'empty:',
        'jqueryui'              : 'vendor/jqueryui',
        'jqueryvalidate'        : 'vendor/jquery.validate.min',
        'plugins'               : 'plugins',
        'main'                  : 'main',
        'city_select'           : 'stub/city_select',
        'drop_down'             : 'stub/drop_down',
        'maps'                  : 'stub/maps',
        'checkboxFilter'        : 'stub/checkboxFilter',
        'metroFilter'           : 'stub/metroFilter',
        'nameFilter'            : 'stub/nameFilter',
        'scroll'                : 'stub/scroll',
        'search'                : 'stub/search',
        'slider'                : 'stub/slider',
        'schedule'              : 'section/schedule',
        'showroom'              : 'section/showroom',
        'forms'                 : 'section/forms',
        'hallplan'              : 'kassa.hallplan'
    },
    //mainConfigFile: "require.config.js",
    include: [ 
        'almond'
        , 'App'
        , 'section/schedule'
        , 'section/forms'
        , 'section/showroom'
        , 'stub/maps'
        , 'stub/city_select'
        , 'stub/search'
        , 'stub/slider'
        , 'hallplan'
    ],
    name: "App",
    out: "dist/App.js",
    inlineText: false,
    wrap: {
        start: "(function(){",
        end: "new (require('App')); \n}());"
    },
    //optimize: 'uglify2'
    optimize: 'none',
    preserveLicenseComments: false
})

SerzN1 avatar Apr 28 '14 07:04 SerzN1

Phew. I will try to reproduce it, but can't guarantee anything. Could also take some time...

asciidisco avatar May 13 '14 11:05 asciidisco

Explanation: https://github.com/gruntjs/grunt-contrib-requirejs/issues/41#issuecomment-52129662

Blasz avatar Aug 14 '14 00:08 Blasz