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

watch command changes file names #715

Open
felixknox opened this issue May 18, 2016 · 3 comments
Open

watch command changes file names #715

felixknox opened this issue May 18, 2016 · 3 comments

Comments

@felixknox
Copy link

felixknox commented May 18, 2016

If I have a file compiled.min.js in assets/js/**, then running roots watch will remove the extension of compiled.min.js, outputting a file compiled.min in /public/js/**. I would expect the file to keep it's name.

Is it possible to bypass this behaviour via options?

@jescalan
Copy link
Owner

jescalan commented May 18, 2016

So multipass compilation is a fairly complex process with very specific rules. You can see a breakdown of these rules here. Based on what you have here, I'd guess that you are using a compiler that processes .js files, which is why you are getting this result. If we change the rules around for multipass it would break many other situations, so I'm afraid we can't change this.

What I would recommend is changing the filename to compiled-min.js. Since you have roots set to process .js files, it's going to take any js file you have in your project and run it through. Most people use roots with coffee or without processing js at all, so this problem hasn't come up in the past.

What we could do from our end is to add an option to pass in a glob matcher that forces files to be copied instead of compiled regardless of the extension. So you could pass an option to app.coffee like forceCopy: 'assets/vendor/**'. If there is enough demand for this or if someone wants to submit a PR, we could definitely make it happen!

@felixknox
Copy link
Author

The rules makes sense. The file in question is a file from an external library managed through bower. So I am not able to change the name of the file without losing consistency.
It is bad naming convention from the library supplier, but it is quite common (also there is no file without the extra dot in the package)

forceCopy would work as external lib files usually does not need to be compiled.

@jescalan
Copy link
Owner

Any interest in taking a stab at contributing forceCopy? It might be a good spot to jump in to the codebase, and I'd be happy to help. Otherwise I can make it happen eventually, but it might be a bit since I have a lot on my plate at the moment, and it's not an issue affecting my company at the moment, so it's hard to get these things to the top of the priorities list.

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

No branches or pull requests

2 participants