Skip to content

Commit

Permalink
Fix issue with loading project root's node_modules path
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite committed Dec 4, 2021
1 parent 2879883 commit 77bae07
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## 1.1.0 - 2021-12-03

- Fix issue with loading project root's node_modules path

## 1.1.0 - 2021-12-03

- Switch to processing SSR through Node sidecar server and various other performance & caching enhancements

## 1.0.0 - 2021-09-25
Expand Down
5 changes: 3 additions & 2 deletions lib/bridgetown-lit-renderer/renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class << self

attr_accessor :site

def self.start_node_server
def self.start_node_server(node_modules_path)
return if serverpid

self.authtoken = SecureRandom.hex(64)
Expand All @@ -23,6 +23,7 @@ def self.start_node_server
{
"LIT_SSR_SERVER_PORT" => serverport.to_s,
"LIT_SSR_AUTH_TOKEN" => authtoken,
"NODE_PATH" => node_modules_path,
},
"node #{File.expand_path("../../src/serve.js", __dir__)}",
pgroup: true
Expand Down Expand Up @@ -86,7 +87,7 @@ def render(code, data:, entry:, caching: true) # rubocop:todo Metrics/MethodLeng
@render_notice_printed = true
end

self.class.start_node_server
self.class.start_node_server(site.in_root_dir("node_modules"))

output = Faraday.post(
"http://127.0.0.1:#{self.class.serverport}",
Expand Down
2 changes: 1 addition & 1 deletion lib/bridgetown-lit-renderer/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module BridgetownLitRenderer
VERSION = "1.1.0"
VERSION = "1.1.1"
end
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bridgetown-lit-renderer",
"version": "1.1.0",
"version": "1.1.1",
"main": "frontend/javascript/index.js",
"exports": {
".": {
Expand Down

0 comments on commit 77bae07

Please sign in to comment.