lib/sewing_kit/webpack/manifest.rb in sewing_kit-0.130.0 vs lib/sewing_kit/webpack/manifest.rb in sewing_kit-0.130.1
- old
+ new
@@ -1,24 +1,25 @@
# frozen_string_literal: true
-require 'open3'
-require 'uri'
+require "open3"
+require "uri"
+
module SewingKit
module Webpack
# Webpack manifest loading, caching & entry point retrieval
class Manifest
class NodeSewingKitManifestMissing < StandardError
def initialize(node_error_message)
super(
"Could not fetch the sewing-kit manifest 🙀 \n" \
- "Possible next steps:\n" \
- " - If the server is still starting up, wait for a " \
- "'Compiled with latest changes' message then refresh your browser\n" \
- " - Check the development console for compilation errors\n" \
- " - Restart your development server\n" \
- "\n" \
- "Original error #{node_error_message}"
+ "Possible next steps:\n" \
+ " - If the server is still starting up, wait for a " \
+ "'Compiled with latest changes' message then refresh your browser\n" \
+ " - Check the development console for compilation errors\n" \
+ " - Restart your development server\n" \
+ "\n" \
+ "Original error #{node_error_message}"
)
end
end
# Raised if the node-generated manifest cannot be read from the filesystem.
@@ -54,11 +55,11 @@
end
def instance
return Production.new if simulate_production?
- @instance ||= if mode == 'development'
+ @instance ||= if mode == "development"
Development.new
elsif skip_assets?
TestWithNoAssets.new
else
Production.new
@@ -66,23 +67,23 @@
end
private
def mode
- ENV['NODE_ENV'] || Rails.env.to_s
+ ENV["NODE_ENV"] || Rails.env.to_s
end
def skip_assets?
- mode == 'test' && SewingKit.configuration.test_manifest_mode == :return_no_assets
+ mode == "test" && SewingKit.configuration.test_manifest_mode == :return_no_assets
end
def simulate_production?
- ENV['SK_SIMULATE_PRODUCTION'] == '1' || ENV['SK_SIMULATE_PRODUCTION'] == 'true'
+ ENV["SK_SIMULATE_PRODUCTION"] == "1" || ENV["SK_SIMULATE_PRODUCTION"] == "true"
end
end
end
end
end
-require 'sewing_kit/webpack/manifest/development'
-require 'sewing_kit/webpack/manifest/production'
-require 'sewing_kit/webpack/manifest/test_with_no_assets'
+require "sewing_kit/webpack/manifest/development"
+require "sewing_kit/webpack/manifest/production"
+require "sewing_kit/webpack/manifest/test_with_no_assets"