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

swp files #25

Open
maisano opened this issue Aug 31, 2016 · 8 comments
Open

swp files #25

maisano opened this issue Aug 31, 2016 · 8 comments

Comments

@maisano
Copy link

maisano commented Aug 31, 2016

thanks for the plugin :)

unfortunately, i've noticed that my vim swap files are being picked up by it:

ERROR in ./src/containers/.Login.js.swp
Module parse failed: ~/dev/project/src/containers/.Login.js.swp Unexpected token (1:6)
You may need an appropriate loader to handle this file type.

not sure it's that big of a deal though–i fixed it by changing where my .swp files get saved.

@nickjj
Copy link
Owner

nickjj commented Aug 31, 2016

Hi,

Were you seeing this issue without using this plugin?

@maisano
Copy link
Author

maisano commented Aug 31, 2016

nope. the error would only occur with the plugin enabled.

@nickjj
Copy link
Owner

nickjj commented Aug 31, 2016

Let me know if PR #19 fixes things for you (it's already merged into the latest release). It introduced a new option that you can set to white list files.

@maisano
Copy link
Author

maisano commented Aug 31, 2016

i should have mentioned that i still get this error as of 0.3.0. that regex unfortunately is a whitelist and doesn't exclude other matches.

i should maybe have a moment to dig deeper into this tonight.

@nickjj
Copy link
Owner

nickjj commented Aug 31, 2016

Right, the PR alone wouldn't fix it. You would be responsible for supplying your own white list, in which case it would ignore the swp file since you wouldn't add it to the list.

@maisano
Copy link
Author

maisano commented Aug 31, 2016

not quite. it's one of two conditions that dictates whether a file gets included. it doesn't match against regex but the next condition picks it up.

@maisano
Copy link
Author

maisano commented Aug 31, 2016

looks like the issue is that walkAndPrefetchAssets is adding arbitrary files to the bundle.

@dleavitt
Copy link

@vladra @maisano

I don't think the extensions regex has anything to do with this (it's for including files that would otherwise be excluded.)

Luckily ignorePaths accepts regexes, so you can get the results you want like this:

ignorePaths: [
  /\.(|min\.js)$/,
  /^\./
]

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

3 participants