-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Webpacker.compile method * Compile (once) on failed manifest lookups in test env * Reword load order / dependencies * Add Webpacker.env inquiry helper * Refactor compile before lookup
- Loading branch information
Showing
8 changed files
with
64 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,24 @@ | ||
module Webpacker | ||
def self.bootstrap | ||
extend self | ||
|
||
def bootstrap | ||
Webpacker::Env.load | ||
Webpacker::Configuration.load | ||
Webpacker::Manifest.load | ||
end | ||
|
||
def compile | ||
Webpacker::Compiler.compile | ||
Webpacker::Manifest.load | ||
end | ||
|
||
def env | ||
Webpacker::Env.current.inquiry | ||
end | ||
end | ||
|
||
require "webpacker/env" | ||
require "webpacker/configuration" | ||
require "webpacker/manifest" | ||
require "webpacker/compiler" | ||
require "webpacker/railtie" if defined?(Rails) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require "rake" | ||
|
||
module Webpacker::Compiler | ||
extend self | ||
|
||
def compile | ||
compile_task.invoke | ||
compile_task.reenable | ||
end | ||
|
||
private | ||
def compile_task | ||
@compile_task ||= load_rake_task("webpacker:compile") | ||
end | ||
|
||
def load_rake_task(name) | ||
@load_rakefile ||= Rake.load_rakefile(Rails.root.join("Rakefile")) | ||
Rake::Task[name] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters