diff --git a/CHANGELOG.md b/CHANGELOG.md index 099e363..05c6d17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/bridgetown-lit-renderer/renderer.rb b/lib/bridgetown-lit-renderer/renderer.rb index 3d377d9..4cd235b 100644 --- a/lib/bridgetown-lit-renderer/renderer.rb +++ b/lib/bridgetown-lit-renderer/renderer.rb @@ -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) @@ -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 @@ -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}", diff --git a/lib/bridgetown-lit-renderer/version.rb b/lib/bridgetown-lit-renderer/version.rb index 7269f73..2604bbb 100644 --- a/lib/bridgetown-lit-renderer/version.rb +++ b/lib/bridgetown-lit-renderer/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module BridgetownLitRenderer - VERSION = "1.1.0" + VERSION = "1.1.1" end diff --git a/package.json b/package.json index 0f45f96..ce32720 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bridgetown-lit-renderer", - "version": "1.1.0", + "version": "1.1.1", "main": "frontend/javascript/index.js", "exports": { ".": {