Copy-webpack-plugin: [Feature] Provide default `context` option

Created on 4 Oct 2017  路  5Comments  路  Source: webpack-contrib/copy-webpack-plugin

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.

Community help wanted Has pull request 5 (nice to have) Needs triage Feature

All 5 comments

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 馃槢

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)

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

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kimgysen picture kimgysen  路  3Comments

stq picture stq  路  5Comments

niksmac picture niksmac  路  3Comments

alexprice1 picture alexprice1  路  5Comments

richmeij picture richmeij  路  5Comments