lib/sewing_kit/webpack/manifest.rb in sewing_kit-0.4.6 vs lib/sewing_kit/webpack/manifest.rb in sewing_kit-0.5.0
- old
+ new
@@ -41,24 +41,16 @@
def manifest_bundled?
!manifest["errors"].any? { |error| error.include? "Module build failed" }
end
def load_manifest
- data = load_static_manifest
- JSON.parse(data)
- end
-
- def load_static_manifest
- File.read(static_manifest_path)
+ JSON.parse(`node_modules/.bin/sewing-kit manifest --mode #{mode}`)
rescue => e
- raise ManifestLoadError.new("Could not load compiled manifest from #{static_manifest_path} - have you run `rake sewing_kit:compile`?", e)
+ raise ManifestLoadError.new("Could not load compiled manifest - have you run `rake sewing_kit:build`?", e)
end
- def static_manifest_path
- ::Rails.root.join(
- ::Rails.configuration.sewing_kit.webpack.manifest_dir,
- ::Rails.configuration.sewing_kit.webpack.manifest_filename
- )
+ def mode
+ ENV['NODE_ENV'] || Rails.env.to_s || 'production'
end
end
end
end
end