From e9859ab25ba7993843747e2a12bc941c6a59a2bf Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Fri, 22 Feb 2019 09:33:05 -0500 Subject: [PATCH 1/2] Fix temporary filesystem location This should fix #29. --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 9a602e8..561927c 100644 --- a/src/index.js +++ b/src/index.js @@ -14,7 +14,7 @@ * the License. */ -import os from 'os'; +import fs from 'fs'; import jsdom from 'jsdom'; import loaderUtils from 'loader-utils'; import LibraryTemplatePlugin from 'webpack/lib/LibraryTemplatePlugin'; @@ -96,7 +96,7 @@ async function prerender (parentCompilation, request, options, inject, loader) { const outputOptions = { // fix: some plugins ignore/bypass outputfilesystem, so use a temp directory and ignore any writes. - path: os.tmpdir(), + path: fs.mkdtempSync('prerenderloader'), filename: FILENAME }; From 45465d14d500d603881496a797b879d5efeb6639 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Fri, 22 Feb 2019 09:56:23 -0500 Subject: [PATCH 2/2] Update index.js --- src/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 561927c..bff2799 100644 --- a/src/index.js +++ b/src/index.js @@ -14,6 +14,8 @@ * the License. */ +import path from 'path'; +import os from 'os'; import fs from 'fs'; import jsdom from 'jsdom'; import loaderUtils from 'loader-utils'; @@ -96,7 +98,7 @@ async function prerender (parentCompilation, request, options, inject, loader) { const outputOptions = { // fix: some plugins ignore/bypass outputfilesystem, so use a temp directory and ignore any writes. - path: fs.mkdtempSync('prerenderloader'), + path: path.join(os.tmpdir(), fs.mkdtempSync('prerenderloader')), filename: FILENAME };