linemanjs / lineman

Lineman helps you build fat-client JavaScript apps. It produces happiness by building assets, mocking servers, running specs on every file change
MIT License
1.18k stars 83 forks source link

Cannot find module '.../mobile-prototype/config/files' #356

Closed bwilln9 closed 9 years ago

bwilln9 commented 9 years ago

Tried to add separate configuration for files under the config/ directory - wanted to find images under images/ instead of img/ (moving an existing project to Lineman with references to this in the html). Didn't do what I wanted, so I tried to remove the 'files.js' file that I had created, from the config/ directory. Now when I try to build I get the following error:

% lineman build Loading "Gruntfile.js" tasks...ERROR

Error: Cannot find module '.../mobile-prototype/config/files' Warning: Task "clean" not found. Use --force to continue.

Aborted due to warnings.

Are the files in the config directory being cached somewhere else, something else that has to be cleaned up?

The config I tried to change was like this:

"img": { "app": "app/images//.", "vendor": "vendor/images//.", "root": "images" },

When I built with this, images ended up under generated/images/app/images, was hoping this would be generated/images.

Any suggestions how to get both these things to work correctly would be much appreciated.

searls commented 9 years ago

Lineman projects are required to have a require-able files.js/files.coffee file in config/ directory, or else the CLI will blow up.

If I ask Lineman what the default image config is with $ lineman config files.img, I get:

{
  "app": "app/img/**/*.*",
  "vendor": "vendor/img/**/*.*",
  "root": "img"
}

So if you wanted to change the config, you'd override your config/files file to return:

return {
  img: {
    "app": "app/images/**/*.*",
    "vendor": "vendor/images/**/*.*",
    "root": "images"
  }
};