dbashford / mimosa

A lightning-fast, modular, next generation browser development tool.
http://mimosa.io/
519 stars 34 forks source link

ublic being placed infront of found dependencies #408

Closed DrSammyD closed 10 years ago

DrSammyD commented 10 years ago

for some reason mimosa isn't using a baseUrl to create includes. not only that but it cuts off the p from public.

Debug - Config for r.js run:
{
  "optimize": "none",
  "logLevel": 3,
  "baseUrl": "/home/samarmstrong/Documents/Github/Durandal-Mimosa-Node-Skeleton/public/javascripts/app",
  "wrap": true,
  "findNestedDependencies": true,
  "mainConfigFile": "./public/javascripts/app/ref.js",
  "include": [
    "requireLib",
    "main",
    "ublic/javascripts/app/jqplugs",
    "ublic/javascripts/app/koplugs",
    "ublic/javascripts/app/main",
    "ublic/javascripts/app/ref",
    "ublic/javascripts/app/locale/current-locale",
    "ublic/javascripts/app/locale/ko-t",
    "ublic/javascripts/app/viewmodels/flickr",
    "ublic/javascripts/app/viewmodels/shell",
    "ublic/javascripts/app/viewmodels/welcome",
    "durandal/activator",
    "durandal/app",
    "durandal/binder",
    "durandal/composition",
    "durandal/events",
    "durandal/system",
    "durandal/viewEngine",
    "durandal/viewLocator",
    "plugins/dialog",
    "plugins/history",
    "plugins/http",
    "plugins/observable",
    "plugins/router",
    "plugins/serializer",
    "plugins/widget",
    "transitions/entrance",
    "text!views/detail.html",
    "text!views/flickr.html",
    "text!views/shell.html",
    "text!views/welcome.html"
  ],
  "insertRequire": [
    "main"
  ],
  "name": "requireLib",
  "out": "/home/samarmstrong/Documents/Github/Durandal-Mimosa-Node-Skeleton/public/javascripts/app/main-built.js",
  "paths": {
    "requireLib": "../vendor/requirejs/require"
  }
}

here's my optimize section

  require:
    optimize:
      inferConfig:true 
      overrides: (infered)->
        infered.optimize = "none"
        infered.mainConfigFile='./public/javascripts/app/ref.js'
        infered.name='requireLib'
        infered.include=['requireLib', 'main']
        infered.insertRequire=['main']
        infered.paths ={'requireLib':'../vendor/requirejs/require'}
        infered.baseUrl= process.cwd()+'/public/javascripts/app'
        infered.out= process.cwd()+'/public/javascripts/app/main-built.js'
        return infered
DrSammyD commented 10 years ago

it had to do with my using baseUrl inside of my mainConfigFile;

DrSammyD commented 10 years ago

I fixed it so that it works on linux by removing my baseUrl from my mainConfigFile, but now the text plugin isn't working on windows

I have a Gist of all the relevant files and the outputs of the configs in debug

you'll see the error in the windows json

DrSammyD commented 10 years ago

found the problem

        infered.baseUrl= process.cwd()+'/public/javascripts/app'
        infered.out= process.cwd()+'/public/javascripts/app/main-built.js' 

needs to be

        infered.baseUrl= process.cwd()+'/public/javascripts/app'.split('/').join(path.sep)
        infered.out= process.cwd()+'/public/javascripts/app/main-built.js'.split('/').join(path.sep)
dbashford commented 10 years ago

It's always good when problems solve themselves before I get involved!

Incorporated your skeleton. Thanks!