linkedin / eyeglass

NPM Modules for Sass
741 stars 60 forks source link

Ember-cli-eyeglass ignores OutputPath #225

Open igbopie opened 5 years ago

igbopie commented 5 years ago

Package This issue is related to the following monorepo package(s):

Description Ember-cli-eyeglass does not respect outputPath configuration like the example in ember docs:

https://ember-cli.com/user-guide/#configuring-output-paths

To Reproduce Steps to reproduce the behavior:

  1. Add outputPath configuration
  2. css file does not appear in the right location

Expected behavior Css file should show in the right location

stefanpenner commented 5 years ago

Could you provide a more detailed example. As that way we can see exactly what you are expecting (input/output).

As eyeglass allows for some additional conventions, it may not be possible to preserve the above semantics in all scenarios. By seeing yours we can provide a more accurate response/fix/idea/doc-fix

igbopie commented 5 years ago

Sure, in the example provided

 outputPaths: {
      app: {
        html: 'index.html',
        css: {
          'app': '/assets/css/application-name.css'
        },
        js: '/assets/js/application-name.js'
      },
      vendor: {
        css: '/assets/css/vendor.css',
        js: '/assets/js/vendor.js'
      }
}

the file application-name.css won't appear under assets/css but assets.

The problem is that here:

https://github.com/linkedin/eyeglass/blob/689b1b7dad4c45deafd96dff19448ff585e94c05/packages/ember-cli-eyeglass/index.js#L89

it is taking outputPath variable which is always assets according to this code:

https://github.com/ember-cli/ember-cli/blob/ef3b0e3626dce3ea40732c9227c5b806f1480302/lib/broccoli/default-packager.js#L608

Instead, the fourth parameter should be used which includes the 'outputPaths' specified in the config.

chriseppstein commented 5 years ago

@stefanpenner IMO, preprocessors shouldn't have to know the internals of ember-cli's configuration. IMO eyeglass should translate .scss to .css and then ember-cli should do these renames on the css files according to the config that it is in charge of implementing.