Specify nodes_modules directory for webpack
Also align ./bin/webpacker-dev-server and ./bin/webpacker
This commit is contained in:
@ -8,6 +8,9 @@ require "webpacker/webpack_runner"
|
|||||||
ENV["RAILS_ENV"] ||= "development"
|
ENV["RAILS_ENV"] ||= "development"
|
||||||
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
|
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
|
||||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", Pathname.new(__FILE__).realpath)
|
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", Pathname.new(__FILE__).realpath)
|
||||||
|
# We need to specify the path to the node_modules/.bin directory
|
||||||
|
# The automatic detection of the path doesn't work in all cases, as it could contain an escape sequence.
|
||||||
|
ENV["WEBPACKER_NODE_MODULES_BIN_PATH"] ||= File.expand_path("../../node_modules/.bin", Pathname.new(__FILE__).realpath)
|
||||||
|
|
||||||
APP_ROOT = File.expand_path("..", __dir__)
|
APP_ROOT = File.expand_path("..", __dir__)
|
||||||
Dir.chdir(APP_ROOT) do
|
Dir.chdir(APP_ROOT) do
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
|
require "pathname"
|
||||||
|
require "bundler/setup"
|
||||||
|
require "webpacker"
|
||||||
|
require "webpacker/dev_server_runner"
|
||||||
|
|
||||||
ENV["RAILS_ENV"] ||= "development"
|
ENV["RAILS_ENV"] ||= "development"
|
||||||
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
|
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
|
||||||
|
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", Pathname.new(__FILE__).realpath)
|
||||||
require "pathname"
|
# We need to specify the path to the node_modules/.bin directory
|
||||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
# The automatic detection of the path doesn't work in all cases, as it could contain an escape sequence.
|
||||||
Pathname.new(__FILE__).realpath)
|
ENV["WEBPACKER_NODE_MODULES_BIN_PATH"] ||= File.expand_path("../../node_modules/.bin", Pathname.new(__FILE__).realpath)
|
||||||
|
|
||||||
require "bundler/setup"
|
|
||||||
|
|
||||||
require "webpacker"
|
|
||||||
require "webpacker/dev_server_runner"
|
|
||||||
|
|
||||||
APP_ROOT = File.expand_path("..", __dir__)
|
APP_ROOT = File.expand_path("..", __dir__)
|
||||||
Dir.chdir(APP_ROOT) do
|
Dir.chdir(APP_ROOT) do
|
||||||
|
Reference in New Issue
Block a user