@@ -382,11 +382,10 @@ const getRollupConfigForApis = async (compilation) => {
382
382
383
383
const getRollupConfigForSsr = async ( compilation , input ) => {
384
384
const { outputDir } = compilation . context ;
385
+ console . log ( 'SSR GOING ON' , { input} ) ;
385
386
386
- // TODO should routes and APIs have chunks?
387
- // https://github.com/ProjectEvergreen/greenwood/issues/1118
388
- return [ {
389
- input,
387
+ return input . map ( filepath => ( {
388
+ input : filepath ,
390
389
output : {
391
390
dir : normalizePathnameForWindows ( outputDir ) ,
392
391
entryFileNames : '_[name].js' ,
@@ -423,7 +422,49 @@ const getRollupConfigForSsr = async (compilation, input) => {
423
422
424
423
}
425
424
}
426
- } ] ;
425
+ } ) )
426
+
427
+ // TODO should routes and APIs have chunks?
428
+ // https://github.com/ProjectEvergreen/greenwood/issues/1118
429
+ // return [{
430
+ // input,
431
+ // output: {
432
+ // dir: normalizePathnameForWindows(outputDir),
433
+ // entryFileNames: '_[name].js',
434
+ // chunkFileNames: '[name].[hash].js'
435
+ // },
436
+ // plugins: [
437
+ // greenwoodJsonLoader(),
438
+ // greenwoodResourceLoader(compilation),
439
+ // // TODO let this through for lit to enable nodeResolve({ preferBuiltins: true })
440
+ // // https://github.com/lit/lit/issues/449
441
+ // // https://github.com/ProjectEvergreen/greenwood/issues/1118
442
+ // nodeResolve({
443
+ // preferBuiltins: true
444
+ // }),
445
+ // commonjs(),
446
+ // greenwoodImportMetaUrl(compilation),
447
+ // greenwoodPatchSsrPagesEntryPointRuntimeImport() // TODO a little hacky but works for now
448
+ // ],
449
+ // onwarn: (errorObj) => {
450
+ // const { code, message } = errorObj;
451
+
452
+ // switch (code) {
453
+
454
+ // case 'CIRCULAR_DEPENDENCY':
455
+ // // TODO let this through for lit by suppressing it
456
+ // // Error: the string "Circular dependency: ../../../../../node_modules/@lit-labs/ssr/lib/render-lit-html.js ->
457
+ // // ../../../../../node_modules/@lit -labs/ssr/lib/lit-element-renderer.js -> ../../../../../node_modules/@lit-labs/ssr/lib/render-lit-html.js\n" was thrown, throw an Error :)
458
+ // // https://github.com/lit/lit/issues/449
459
+ // // https://github.com/ProjectEvergreen/greenwood/issues/1118
460
+ // break;
461
+ // default:
462
+ // // otherwise, log all warnings from rollup
463
+ // console.debug(message);
464
+
465
+ // }
466
+ // }
467
+ // }];
427
468
} ;
428
469
429
470
export {
0 commit comments