-
-
Notifications
You must be signed in to change notification settings - Fork 488
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
Support output.path interpolation #304
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -35,6 +35,7 @@ class BundleAnalyzerPlugin { | |||
|
|||
const done = (stats, callback) => { | |||
callback = callback || (() => {}); | |||
const bundleDir = stats.compilation.getPath(stats.compilation.outputOptions.path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea if this getPath
function is a public API from webpack. And neither do I know if stats.compilation.outputOptions.path
is OK to use here.
|
||
await webpackCompile(config); | ||
|
||
const chartData = await getChartDataFromReport('7e56a1f8a54acedcc9ce/report.html'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this hash is the same across different webpack versions... this might cause a very brittle test.
I don't yet have good ideas on how to figure out the hash that was used to get to the report page.
} else if (this.opts.analyzerMode === 'static') { | ||
actions.push(() => this.generateStaticReport(stats.toJson())); | ||
actions.push(() => this.generateStaticReport(stats.toJson(), bundleDir)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a huge fan in how I had to add another argument to these methods to get this working
Resolves #297