grunt requirejs compile multi

I have issues with compile multi-mainConfigFile in grunt-contrib-requirejs.

I don't know how to configure the gruntfile.js,although read page 'Grunt & requirejs optimizer for a multi app project'.

  • I have thesee files
  • . ├── index.js ├── main.js └── module ├── common.js └── dao.js

  • requirejs config in gruntfile.js
  • ```
    requirejs: {

    compile: {
    
       options: {
    
         name : "main",
                    optimize: "uglify",
                    mainConfigFile: "./assets/js/main.js",
                    out: "./static/js/app.min.js"
                }
            }
        }
    

    ```

    That is all .

    I want to compile index.js and main.js .

    Please help me.


    I think the article you read is saying make another sibling block to compile with the other configuration.

    eg

    requirejs: {
      main: {
        options: {
          // first config
        }
      },
      index: {
        options: {
          // second config
        }
      }
    }
    

    On a side note, if you want shared dependencies across the two apps and one config file, there's a concept called requirejs modules.

    链接地址: http://www.djcxy.com/p/93636.html

    上一篇: Grunt requirejs嵌套的依赖关系

    下一篇: grunt requirejs编译多个