Skip to content

Commit 567f74e

Browse files
intrnlScriptedAlchemy
authored andcommitted
feat: export as json instead of object literal (faceyspacey#186)
1 parent bea9514 commit 567f74e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/loader.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,11 @@ export function pitch(request) {
182182
}
183183

184184
let resultSource = `// extracted by ${pluginName}`;
185+
const json = JSON.stringify(locals);
186+
const stringified = JSON.stringify(json);
187+
185188
const result = locals
186-
? `\nmodule.exports = ${JSON.stringify(locals)};`
189+
? `\nmodule.exports = JSON.parse(${stringified});`
187190
: '';
188191

189192
resultSource += options.hot

0 commit comments

Comments
 (0)