Skip to content

Instantly share code, notes, and snippets.

@geddski
Created July 30, 2014 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geddski/e70685ec9560c7d1c4d1 to your computer and use it in GitHub Desktop.
Save geddski/e70685ec9560c7d1c4d1 to your computer and use it in GitHub Desktop.

Here's the project structure:

project
  |--main/
      config.js
      app.js
  |--subproject/
      app.js

project/main is the baseUrl. The main app's config.js references "subproject" with:

paths: {
  "subproject" : "../subproject"
}

RequireJS is happy during development. I want the build to produce:

project
  |--main-built/
      app.js
  |--subproject-built/
      app.js

but currently the requirejs build adds "subproject" back into "main-built/" directory.

@jrburke
Copy link

jrburke commented Jul 30, 2014

Right, normally would target project if doing a whole project optimization. However, if it is really that main and subproject are really two, fully separate projects, and you just want to share some config between them, then I would use the approach in the multiple out example, but in this case, for the var configs array of builds, you would be using modules instead of out, the first modules build would be for main, the second entry in configs would have a modules section just for subproject.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment