Skip to content

Commit 5b5f1d4

Browse files
committed
Made changes as requested
1 parent eb960cc commit 5b5f1d4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/debug/ProfilingPlugin.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const fs = require("fs");
22
const path = require("path");
3+
const mkdirp = require("mkdirp");
34
const { Tracer } = require("chrome-trace-event");
45
const validateOptions = require("schema-utils");
56
const schema = require("../../schemas/plugins/debug/ProfilingPlugin.json");
@@ -87,17 +88,16 @@ class Profiler {
8788

8889
/**
8990
* @param {string} outputPath The ___location where to write the log.
90-
* @param {Object} compiler Current compiler Instance
9191
* @returns {Trace} The trace object
9292
*/
93-
const createTrace = (outputPath, compiler) => {
93+
const createTrace = outputPath => {
9494
const trace = new Tracer({
9595
noStream: true
9696
});
9797
const profiler = new Profiler(inspector);
98-
if (outputPath.match(/\/|\\/)) {
99-
const dir = path.dirname(outputPath);
100-
compiler.outputFileSystem.mkdirp(dir);
98+
if (/\/|\\/.test(outputPath)) {
99+
const dirPath = path.dirname(outputPath);
100+
mkdirp.sync(dirPath);
101101
}
102102
const fsStream = fs.createWriteStream(outputPath);
103103

@@ -164,7 +164,7 @@ class ProfilingPlugin {
164164
}
165165

166166
apply(compiler) {
167-
const tracer = createTrace(this.outputPath, compiler);
167+
const tracer = createTrace(this.outputPath);
168168
tracer.profiler.startProfiling();
169169

170170
// Compiler Hooks

0 commit comments

Comments
 (0)