Skip to content

Commit 3f6b743

Browse files
committed
site: add REPL imports to .zip's pkg.devDependencies (sveltejs#3795)
1 parent 4c23997 commit 3f6b743

File tree

1 file changed

+3
-3
lines changed
  • site/src/routes/repl/[id]/_components/AppControls

1 file changed

+3
-3
lines changed

site/src/routes/repl/[id]/_components/AppControls/index.svelte

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@
140140
if (imports.length > 0) {
141141
const idx = files.findIndex(({ path }) => path === 'package.json');
142142
const pkg = JSON.parse(files[idx].data);
143-
const deps = {};
143+
const { devDependencies } = pkg;
144144
imports.forEach(mod => {
145145
const match = /^(@[^/]+\/)?[^@/]+/.exec(mod);
146-
deps[match[0]] = 'latest';
146+
devDependencies[match[0]] = 'latest';
147147
});
148-
pkg.dependencies = deps;
148+
pkg.devDependencies = devDependencies;
149149
files[idx].data = JSON.stringify(pkg, null, ' ');
150150
}
151151

0 commit comments

Comments
 (0)