Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/cli/src/config/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ function greenwoodResourceLoader(compilation, browser = false) {
return {
name: "greenwood-resource-loader",
async resolveId(id, importer, options) {
// fix for nested type imports - https://github.com/ProjectEvergreen/greenwood/issues/1576
if (id.indexOf("@greenwood") >= 0) {
return {
id,
external: true,
};
}

const { userWorkspace, scratchDir } = compilation.context;
const normalizedId = cleanRollupId(id);
const importerUrl = new URL(`file://${cleanRollupId(importer) ?? ""}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ describe("Build Greenwood With: ", function () {

expect(jsFiles.length).to.equal(1);
expect(javascript.replace(/\n/g, "")).to.contain(
'const o="Angela",l="Davis",s="Professor";console.log(`Hello ${s} ${o} ${l}!`);',
'const o="Angela",e="Davis",l="Professor";console.log(`Hello ${l} ${o} ${e}!`);',
);
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import { type Page } from "@greenwood/cli";

const pages: Page[] = [];

console.log({ pages });

interface User {
firstName: string;
lastName: string;
Expand Down