-
Notifications
You must be signed in to change notification settings - Fork 37
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
Support ignoring files (esp. during --watch) #24
Comments
Hmm. thanks for bringing this to my attention, I can see how this would be an issue. I see how this can be an issue. They are all pretty good solutions. |
(setq create-lockfiles nil) in emacs config file seems to work around this issue |
Yep.. that’s what I’m using as a workaround atm, in a dir-locals file, but I do want lock files and other editor/tools might be creating other similar files etc. |
I've just ran into this issue as well (#40). I'd rather not turn off lockfiles. If I come up with another workaround I'll post it here. |
I released version 1.0.0 of node-sass-chokidar and there is a new option |
@michaelwayman I use git submodules in my project. I read the code and see that it only allows excluding by filename. Any chance we can allow excluding directories or a regex on the full path? My git submodule is a project on its own that can have |
@dosentmatter I'm assuming you still want to be able to import the Like you want to be able to |
@michaelwayman, yeah I would still want to be able to import the This is what I mean, with bootstrap installed in
Now with a single project, this would be easy:
I set the input folder as In this image, I want to be able to build The reason I have this project structure is because I chose to have I hope this gives enough background. Thanks! |
If you prefix an
_variables.sass $background: #006699 index.sass @import './variables'
body
background: $background index.js import './styles/index.css'; |
@sprlwrksAprilmintacpineda, thanks for the response. Unfortunately, that won't work for me because the files I am trying to exclude are not under my control. They are from a node_modules folder in a nested git submodule. |
@dosentmatter Hello, we have exactly the same problem as you, did you find any solution ? |
@callain, sorry for the late response. My solution was just to build one scss file and not multiple files. So compared to the file I posted above, I'm not building the whole src folder anymore. I'm only building
This solution works fine for me because I am using styled-components for locally scoped CSS. Writing I know this solution isn't ideal, but hopefully it can work for you. The only case I can think of that doesn't work is when you need to import locally scoped CSS like in css-modules, which you won't have access to in this solution since there will only be one Other things you can try:
I hope this helped! |
Ok your solution could work for us indeed, but will need to move all imports for all our components (100+) in a one .scss. But since our submodule is only build when included in a project (at the moment), we didn't go for the package.json inside it. Yesterday I've found an other solution which I didn't know about. You can add a dependency directly for a private repos. It looks like this.
Doc here : https://docs.npmjs.com/files/package.json#git-urls-as-dependencies In the middle of this page, its explained how npm and yarn manage this kind of dependencies and why this works better with yarn(not advocating for anything thougth). Its not as convenient as a submodule because you need to |
@callain, yeah the only reason my solution works fine is because I don't have many .scss files. I knew about the git dependencies, but decided not to use it. The reason was because I didn't want to have to make a commit to test changes in the top level project. I wanted to have local changes in both repositories, so I could test components in the top level project before pushing. Thanks for the suggestion though. |
My problem: Emacs creates lockfiles, named something like
.#filename.scss
, when the file is edited.They're "broken" symlinks, pointing to a target like
user@host.pid:timestamp
, and they're automatically deleted once the file is saved. Unfortunately, picking them up causes the build process to choke with anENOENT
.This didn't happen as often with node-sass, because it's broken and tends to fail picking up new files.
Some ways in which this could be solved:
--ignore <regex>
(or an environment variable perhaps?)_*
files here: https://github.com/michaelwayman/node-sass-chokidar/blob/master/bin/node-sass-chokidar#L366 (I don't think anyone is interested in having them built anyways).*
or.#*
. They actually do that out of the box for a bunch of common temp files, see https://github.com/paulmillr/chokidar/blob/master/index.js#L349Probably 2 or 3 are quicker to implement; I'd imagine you'd want to avoid having to maintain a huge list of all possible temporary files to be ignored, but I guess just ignoring hidden files would be a good compromise?
The text was updated successfully, but these errors were encountered: