Skip to content

Commit

Permalink
refresh for new Greenwood website and latest release (#5)
Browse files Browse the repository at this point in the history
* refresh for new website and latest greenwood release

* downgrade to node 18

* minor dom opt-out refactor
  • Loading branch information
thescientist13 authored Nov 7, 2024
1 parent 218d9ed commit e77e8c2
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 798 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
21.0.0
18.20.4
9 changes: 3 additions & 6 deletions greenwood.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ class ImportHtmlResource extends ResourceInterface {
this.contentType = 'text/javascript';
}

// TODO should this be an intercept?
// TODO how to best tell this was an import attribute specifically other then searchParams???
async shouldServe(url, request) {
const { pathname, searchParams } = url;
async shouldServe(url) {
const { searchParams } = url;

// TODO (nice to have) better way to test for import attributes via URL, e.g. force attributes as query params somehow?
return pathname.endsWith(this.extensions[0]); // || (request.headers.get('Content-Type') || '').includes(this.contentType);
return searchParams.get('type') === this.extensions[0]
}

async serve(url) {
Expand Down
Loading

0 comments on commit e77e8c2

Please sign in to comment.