Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit 1b963e2

Browse files
committed
[react-source] Use production build according to React::Config
1 parent 57e0d6f commit 1b963e2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/react/react-source.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
"Warning: `react/react-source` is deprecated, ",
55
"use `react/react-source-browser` or `react/react-source-server` instead."
66
]
7-
console.error(ms.join(""));
7+
console.error(ms.join(""));
88
}
99
require 'react.js'
1010
require "react-server.js"
1111
else
12+
require "react/config"
1213
require "react/rails/asset_variant"
13-
react_directory = React::Rails::AssetVariant.new(addons: true).react_directory
14+
react_directory = React::Rails::AssetVariant.new(
15+
addons: true,
16+
variant: React::Config.config[:environment].to_sym
17+
).react_directory
1418
Opal.append_path react_directory.untaint
1519
Opal.append_path File.expand_path('../../react-sources/', __FILE__).untaint
1620
end

0 commit comments

Comments
 (0)