Skip to content

Commit 033828d

Browse files
authored
add build target to svelte config (#432)
1 parent d49063b commit 033828d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/lib/project.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ function scaffoldSvelte() {
344344
const customViteConfig = vitConfig.replace(
345345
/^}(.*?)$/gm, // Search for the last '}' in the file.
346346
`,
347+
build: {
348+
target: 'esnext'
349+
},
347350
optimizeDeps: { esbuildOptions: { target: 'esnext' } }
348351
});`
349352
);
@@ -566,8 +569,8 @@ async function scaffoldNext(projectName) {
566569

567570
console.log(
568571
'Using project name ' +
569-
projectName +
570-
' for github repo name. Please change in next.config.js and pages/reactCOIServiceWorker.tsx if this is not correct or changes'
572+
projectName +
573+
' for github repo name. Please change in next.config.js and pages/reactCOIServiceWorker.tsx if this is not correct or changes'
571574
);
572575

573576
let newNextConfig = nextConfig.replace(
@@ -598,19 +601,17 @@ async function scaffoldNext(projectName) {
598601
// Add some scripts to the package.json
599602
let x = fs.readJSONSync(`ui/package.json`);
600603
x.scripts['export'] = 'next export';
601-
const deployScript = `next build && next export && ${
602-
isWindows
604+
const deployScript = `next build && next export && ${isWindows
603605
? `type nul > ${path.join('out', '.nojekyll')}`
604606
: `touch ${path.join('out', '.nojekyll')}`
605-
} && git add -f out && git commit -m "Deploy gh-pages" && cd .. && git subtree push --prefix ui/out origin gh-pages`;
607+
} && git add -f out && git commit -m "Deploy gh-pages" && cd .. && git subtree push --prefix ui/out origin gh-pages`;
606608
x.scripts['deploy'] = deployScript;
607609
fs.writeJSONSync(path.join('ui', 'package.json'), x, { spaces: 2 });
608610

609611
sh.cd('ui');
610612
await step(
611613
'COI-ServiceWorker: NPM install',
612-
`npm install coi-serviceworker --save > ${
613-
isWindows ? 'NUL' : '"/dev/null" 2>&1'
614+
`npm install coi-serviceworker --save > ${isWindows ? 'NUL' : '"/dev/null" 2>&1'
614615
}`
615616
);
616617

0 commit comments

Comments
 (0)