Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefix ignored when running #88

Closed
silverlight513 opened this issue Nov 25, 2016 · 1 comment · Fixed by #96
Closed

prefix ignored when running #88

silverlight513 opened this issue Nov 25, 2016 · 1 comment · Fixed by #96

Comments

@silverlight513
Copy link

silverlight513 commented Nov 25, 2016

I have two calls for css files in my index.html, one uses the prefix the other does not. Both css files are picked up by sass-middleware instead of just the one with the prefix.

My config looks like this:

{
    src: path.join(__dirname, './client/sass'),
    dest: path.join(__dirname, './dist'),
    debug: true,
    outputStyle: 'compressed',
    prefix:  '/css'
}

I have links in my html that look like:

<link rel="stylesheet" href="/css/app.css" type="text/css">
<link rel="stylesheet" href="/outdated-browser/outdatedbrowser.min.css" type="text/css">

I am aware that I can just put the express.static method for outdated browser above the sass middleware and it won't get picked up by the middleware but the middleware shouldn't be picking it up anyway.

@am11
Copy link
Collaborator

am11 commented Dec 5, 2016

Admittedly, the prefix mechanics are bit tricky to get the middleware setup right. See this conversation #49 (comment) which points to an example project. I hope that will help.

@am11 am11 mentioned this issue Jan 14, 2017
am11 added a commit that referenced this issue Jan 15, 2017
* If the requested file is not .css, log and skip (new: log, we were already skipping here)
* If the requested file does not starts with provided prefix, log and prefix (new)
* Provide reason for compile logs (new)
* Add more logger tests

Fixes #88
am11 added a commit that referenced this issue Jan 15, 2017
* If the requested file is not .css, log and skip (new: log, we were already skipping here)
* If the requested file does not starts with provided prefix, log and prefix (new)
* Provide reason for compile logs (new)
* Add more logger tests

Fixes #88
am11 added a commit that referenced this issue Jan 15, 2017
* If the requested file is not .css, log and skip (new: log, we were already skipping here)
* If the requested file does not starts with provided prefix, log and prefix (new)
* Provide reason for compile logs (new)
* Add more logger tests

Fixes #88
@am11 am11 closed this as completed in #96 Jan 16, 2017
am11 added a commit that referenced this issue Jan 16, 2017
Skip early and log when prefix mismatches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants