Skip to content

Commit

Permalink
feat(instructions): generate inertia config with ssr enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
eidellev committed Jul 30, 2022
1 parent 7f832bc commit b32e4ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions instructions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default async function instructions(projectRoot: string, app: Application
if (shouldEnableSsr) {
const spinner = sink.logger.await(`Installing SSR dependencies`);
try {
pkg.install('webpack-node-externals');
pkg.install('webpack-node-externals', undefined, true);
await pkg.commitAsync();
spinner.update('Packages installed');
sink.logger.success('All done!');
Expand All @@ -128,7 +128,7 @@ export default async function instructions(projectRoot: string, app: Application
* Generate inertia config
*/
inertiaConfig.overwrite = true;
inertiaConfig.apply({ view }).commit();
inertiaConfig.apply({ view, shouldEnableSsr }).commit();

const configDir = app.directoriesMap.get('config') || 'config';
sink.logger.action('create').succeeded(`${configDir}/inertia.ts`);
Expand Down
3 changes: 3 additions & 0 deletions templates/inertia.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ import { InertiaConfig } from '@ioc:EidelLev/Inertia';

export const inertia: InertiaConfig = {
view: '{{view}}',
ssr: {
enabled: {{shouldEnableSsr}},
},
};

0 comments on commit b32e4ac

Please sign in to comment.