This repository was archived by the owner on Mar 23, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -9,16 +9,16 @@ module Requirejs::Rails
9
9
class Config < ::ActiveSupport ::OrderedOptions
10
10
LOADERS = [ :requirejs , :almond ]
11
11
12
- def initialize
12
+ def initialize ( application )
13
13
super
14
14
self . manifest = nil
15
15
16
16
self . logical_asset_filter = [ /\. js$/ , /\. html$/ , /\. txt$/ ]
17
- self . tmp_dir = Rails . root + 'tmp'
17
+ self . tmp_dir = application . root + 'tmp'
18
18
self . bin_dir = Pathname . new ( __FILE__ +'/../../../../bin' ) . cleanpath
19
19
20
20
self . source_dir = self . tmp_dir + 'assets'
21
- self . target_dir = Rails . root + 'public/assets'
21
+ self . target_dir = application . root + 'public/assets'
22
22
self . rjs_path = self . bin_dir +'r.js'
23
23
24
24
self . loader = :requirejs
Original file line number Diff line number Diff line change @@ -6,12 +6,14 @@ module Requirejs
6
6
module Rails
7
7
class Engine < ::Rails ::Engine
8
8
### Configuration setup
9
+ config . before_configuration do |app |
10
+ config . requirejs = Requirejs ::Rails ::Config . new ( app )
11
+ config . requirejs . precompile = [ /require\. js$/ ]
12
+ end
13
+
9
14
config . before_initialize do |app |
10
15
config = app . config
11
16
12
- config . requirejs = Requirejs ::Rails ::Config . new
13
- config . requirejs . precompile = [ /require\. js$/ ]
14
-
15
17
# Process the user config file in #before_initalization (instead of #before_configuration) so that
16
18
# environment-specific configuration can be injected into the user configuration file
17
19
Engine . process_user_config_file ( app , config )
You can’t perform that action at this time.
0 commit comments