-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Ignoring files? #322
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
Comments
I thought you could use the exclude option and pass it some regex? (not tested at all....) exclude: [
/(~$)/,
] |
@cgs Could you please try what Zack suggested? We should probably add some excludes by default, but I guess that still won't be one size fits all (may be a config option would be better). |
@gauravtiwari Trying the above:
So, I tried this in app/config/webpack/shared.js:
No dice there either. Sorry, new to webpack so I'm a bit lost! |
I think you would need to add that to {
test: /\.vue$/,
// rest of the config
exclude: [
/(~$)/
]
} |
BTW, no need of |
Yeah, it should be per-loader that you can add exclusions. I agree there should be a concept of global settings that each loader could inherit off of?... (Just thinking out loud) |
@gauravtiwari @ZackMattor My vue loader:
It's still not excluding the file. It's still not clear to me if the pattern I want to exclude needs to be in "test" and "exclude" or just "exclude." I tried both. On a separate note, even if this worked I'd need to do the same thing in the babel loader I'd guess for js files. |
module.exports = {
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
scss: 'vue-style-loader!css-loader!sass-loader',
sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax'
}
},
exclude: [
/(~$)/
]
} @cgs Please try the above loader 👍 |
Still not working. |
Alright, just tested it out and think the problem is you need a new loader that test for that extension. Sorry for back and forth. So, what you need to do is -
// loaders/ignores.js
module.exports = {
test: /.vue~$/,
loader: 'ignore-loader'
} |
@gauravtiwari Success! 👍 I had installed that at one point but was not using it correctly. Would adding something to the readme about this be helpful? |
Document this in README/guide - #372 |
Just a thought. It seems like a |
Is there a good way to ignore/exclude files on the dev server? Webpack keeps choking on my emacs backup files, such as "foo.vue~". I'd like to ignore all files ending in "~" but I'm not sure how to do it.
I tried adding watchOptions.ignored to config/webpack/development.js to no avail:
Is something like the ignore-loader plugin necessary for this?
The text was updated successfully, but these errors were encountered: