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

[Feature] Provide default context option #148

Closed
cletusw opened this issue Oct 4, 2017 · 5 comments
Closed

[Feature] Provide default context option #148

cletusw opened this issue Oct 4, 2017 · 5 comments

Comments

@cletusw
Copy link
Contributor

cletusw commented Oct 4, 2017

Currently, context defaults to compiler.options.context from webpack. However, I'd like all my copy patterns to use ./src as the default context, even though I can't change my webpack context to that for other reasons.

Could we add a fallback to the plugin options? The overall context fallback logic would be:

context property on pattern object -> context property in plugin options -> context property on webpack config

If this sounds okay, I can try to come up with a PR.

@michael-ciniawsky
Copy link
Member

The pattern.context isn't sufficient enough for you I guess?

{
   context: 'from/directory', // <= ?
   from: '**/*',
   to: '/absolute/path'
}

Feel free to open a PR if you want to tackle this of course 😛

@cletusw
Copy link
Contributor Author

cletusw commented Oct 5, 2017

Right, all of my patterns are going to repeat the same context, so it'd be nice to just have it once (while allowing overrides, of course)

cletusw added a commit to cletusw/copy-webpack-plugin that referenced this issue Oct 5, 2017
Overrides webpack context, overridden by pattern context

Fixed webpack-contrib#148
cletusw added a commit to cletusw/copy-webpack-plugin that referenced this issue Oct 5, 2017
Overrides webpack context, overridden by pattern context

Fixes webpack-contrib#148
@cletusw
Copy link
Contributor Author

cletusw commented Oct 5, 2017

@michael-ciniawsky Created #149 to add this option.

cletusw added a commit to cletusw/copy-webpack-plugin that referenced this issue Oct 5, 2017
Overrides webpack context, overridden by pattern context

Fixes webpack-contrib#148
@michael-ciniawsky michael-ciniawsky changed the title Provide default context option [Feature] Provide default context option Oct 5, 2017
@michael-ciniawsky
Copy link
Member

@cletusw Any idea on this one #58 :) ?

@cletusw
Copy link
Contributor Author

cletusw commented Oct 5, 2017

@michael-ciniawsky Just added a comment. Not sure what the expected behavior is.

cletusw added a commit to cletusw/copy-webpack-plugin that referenced this issue Oct 19, 2017
Overrides webpack context, overridden by pattern context

Fixes webpack-contrib#148
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants