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

Add outputPath as plugin option, override conditional checks #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ksrb
Copy link

@ksrb ksrb commented Mar 24, 2017

This plugin seems to be a little broken?

This PR lets the sandbox work with [email protected] + [email protected].

I don't think this PR should necessarily be merged as it changes the API but I'm just highlighting the problem and a potential solution.

Additional Details

In webpack 1.x
I couldn't get the sandbox to work with [email protected] + [email protected] due to it throwing:

output.path is not. Define output.path.

In webpack 2.x
I couldn't get the sandbox to work with [email protected] + [email protected] due to it throwing:

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
...

There's clearly been a API change in webpack 2.x since the beta 😄 .

@ksrb ksrb force-pushed the outputPathOption branch from a2b90c8 to 6a669de Compare March 24, 2017 22:17
@odensc
Copy link
Contributor

odensc commented Apr 7, 2017

Ah - the newest version of this plugin only supports webpack 2.x, hence the major version change. The sandbox should be updated to reflect the version requirement.

if (_.has(compiler, 'options.output.path') && compiler.options.output.path !== '/') {
outputPath = compiler.options.output.path;
if (options.outputPath) {
outputPath = options.outputPath;
Copy link

@jkomusin jkomusin Apr 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this will cause the plugin to fail if no outputPath option is specified (see the check below this). For backwards compatibility it may want to fall back to the original output.path of the compiler.

@jkomusin
Copy link

This would be a very helpful addition for us, as we organize different types of resulting bundles into sub-directories under the root Webpack output path. This flag would allow us to circumvent plugins that don't agree with that, like HotModuleReplacement which dumps hot-update files into the root output path.

@gajus
Copy link
Owner

gajus commented Apr 26, 2018

Is this still relevant?

@odensc
Copy link
Contributor

odensc commented Apr 27, 2018

@gajus #37 fixed the error, but this could still be useful in the case you'd want write-file-webpack-plugin to write to a different path than output.path.

@gajus
Copy link
Owner

gajus commented Apr 28, 2018

If the conflicts are resolved, I will merge it.

@yyynnn

This comment has been minimized.

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

Successfully merging this pull request may close these issues.

5 participants