webpacker-pnpm 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitattributes +0 -0
- data/.github/FUNDING.yml +3 -0
- data/.github/workflows/ci.yaml +50 -0
- data/.gitignore +5 -2
- data/.rubocop.yml +24 -91
- data/CHANGELOG.md +69 -45
- data/Gemfile +8 -17
- data/LICENSE +29 -0
- data/README.md +33 -35
- data/Rakefile +11 -11
- data/bin/console +15 -15
- data/bin/setup +8 -8
- data/gemfiles/Gemfile-rails.5.2.x +0 -0
- data/gemfiles/Gemfile-rails.6.0.x +0 -0
- data/lib/webpacker/pnpm/patches.rb +61 -53
- data/lib/webpacker/pnpm/railtie.rb +33 -24
- data/lib/webpacker/pnpm/version.rb +9 -7
- data/lib/webpacker/pnpm.rb +5 -5
- data/lib/webpacker/tasks/check_pnpm.rake +42 -27
- data/lib/webpacker/tasks/env.rake +22 -20
- data/lib/webpacker/tasks/pnpm_install.rake +14 -14
- data/test/rake_tasks_test.rb +97 -106
- data/test/test_app/.gitignore +6 -6
- data/test/test_app/Rakefile +5 -5
- data/test/test_app/app/javascript/packs/application.js +10 -10
- data/test/test_app/app/javascript/packs/multi_entry.css +3 -3
- data/test/test_app/app/javascript/packs/multi_entry.js +4 -4
- data/test/test_app/bin/rails +4 -6
- data/test/test_app/bin/rake +4 -6
- data/test/test_app/bin/setup +25 -27
- data/test/test_app/bin/webpack +15 -14
- data/test/test_app/bin/webpack-dev-server +15 -14
- data/test/test_app/config/application.rb +13 -13
- data/test/test_app/config/boot.rb +5 -0
- data/test/test_app/config/environment.rb +6 -6
- data/test/test_app/config/webpack/development.js +0 -0
- data/test/test_app/config/webpack/environment.js +0 -0
- data/test/test_app/config/webpacker.yml +0 -0
- data/test/test_app/config/webpacker_public_root.yml +19 -19
- data/test/test_app/config.ru +7 -7
- data/test/test_app/package.json +0 -0
- data/test/test_app/pnpm-lock.yaml +0 -0
- data/test/test_app/public/packs/manifest.json +31 -31
- data/test/test_helper.rb +61 -64
- data/webpacker-pnpm.gemspec +44 -36
- metadata +72 -42
- data/.travis.yml +0 -45
- data/gemfiles/Gemfile-rails-edge +0 -12
@@ -1,24 +1,33 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "rails/railtie"
|
4
|
-
|
5
|
-
module Webpacker
|
6
|
-
module PNPM
|
7
|
-
class Railtie < Rails::Railtie
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/railtie"
|
4
|
+
|
5
|
+
module Webpacker
|
6
|
+
module PNPM
|
7
|
+
class Railtie < Rails::Railtie
|
8
|
+
rake_tasks do
|
9
|
+
# load all the rake tasks within the `tasks` directory
|
10
|
+
Dir[File.join(File.dirname(__FILE__), "../tasks/**/*.rake")].each do |task|
|
11
|
+
load task
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# manually specify node_modules bin path to skip Yarn execution during
|
16
|
+
# Webpack runner initialization
|
17
|
+
config.before_configuration do
|
18
|
+
begin
|
19
|
+
ENV["WEBPACKER_NODE_MODULES_BIN_PATH"] ||= File.join(`pnpm root`.chomp, ".bin")
|
20
|
+
rescue Errno::ENOENT
|
21
|
+
# use abort instead of Rails' logger because it doesn't show up when
|
22
|
+
# run within Rake tasks
|
23
|
+
abort(
|
24
|
+
<<~HEREDOC.squish
|
25
|
+
\e[31m[FATAL] pnpm is not installed or not present in $PATH.
|
26
|
+
Install pnpm and try again.\e[0m
|
27
|
+
HEREDOC
|
28
|
+
)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/webpacker/pnpm.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "pnpm/version"
|
4
|
-
require_relative "pnpm/railtie"
|
5
|
-
require_relative "pnpm/patches"
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "pnpm/version"
|
4
|
+
require_relative "pnpm/railtie"
|
5
|
+
require_relative "pnpm/patches"
|
@@ -1,27 +1,42 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "semantic_range"
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "semantic_range"
|
4
|
+
|
5
|
+
namespace :webpacker do
|
6
|
+
desc "Verifies if pnpm is installed"
|
7
|
+
task check_pnpm: [:environment] do
|
8
|
+
begin
|
9
|
+
$stdout.puts "Verifying pnpm version..."
|
10
|
+
|
11
|
+
pnpm_version = `pnpm --version`.chomp
|
12
|
+
raise Errno::ENOENT if pnpm_version.blank?
|
13
|
+
|
14
|
+
begin
|
15
|
+
pnpm_range = ">= 3.0.0"
|
16
|
+
is_unsupported = SemanticRange.satisfies?(pnpm_version, pnpm_range)
|
17
|
+
rescue StandardError
|
18
|
+
is_unsupported = false
|
19
|
+
end
|
20
|
+
|
21
|
+
unless is_unsupported
|
22
|
+
warn(
|
23
|
+
<<~HEREDOC.squish
|
24
|
+
Webpacker requires pnpm \"#{pnpm_range}\" and you are using #{pnpm_version}.
|
25
|
+
Please upgrade pnpm https://pnpm.js.org/en/installation/.
|
26
|
+
HEREDOC
|
27
|
+
)
|
28
|
+
warn("Exiting!")
|
29
|
+
exit!
|
30
|
+
end
|
31
|
+
rescue Errno::ENOENT
|
32
|
+
warn(
|
33
|
+
<<~HEREDOC.squish
|
34
|
+
pnpm is not installed. Please download and install pnpm from
|
35
|
+
https://pnpm.js.org/en/installation/.
|
36
|
+
HEREDOC
|
37
|
+
)
|
38
|
+
warn("Exiting!")
|
39
|
+
exit!
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -1,20 +1,22 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "webpacker/version"
|
4
|
-
|
5
|
-
namespace :webpacker do
|
6
|
-
desc "Provide information on Webpacker's environment"
|
7
|
-
task env: [:environment] do
|
8
|
-
$stdout.puts "Ruby: #{`ruby --version`}"
|
9
|
-
$stdout.puts "Rails: #{Rails.version}"
|
10
|
-
$stdout.puts "Webpacker: #{Webpacker::VERSION}"
|
11
|
-
$stdout.puts "Node: #{`node --version`}"
|
12
|
-
$stdout.puts "pnpm: #{`pnpm --version`}"
|
13
|
-
|
14
|
-
$stdout.puts "\n"
|
15
|
-
$stdout.puts "@rails/webpacker: \n#{`npm list @rails/webpacker version`}"
|
16
|
-
|
17
|
-
$stdout.puts "Is bin/webpack present?: #{File.exist?
|
18
|
-
$stdout.puts
|
19
|
-
|
20
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "webpacker/version"
|
4
|
+
|
5
|
+
namespace :webpacker do
|
6
|
+
desc "Provide information on Webpacker's current environment"
|
7
|
+
task env: [:environment] do
|
8
|
+
$stdout.puts "Ruby: #{`ruby --version`}"
|
9
|
+
$stdout.puts "Rails: #{Rails.version}"
|
10
|
+
$stdout.puts "Webpacker: #{Webpacker::VERSION}"
|
11
|
+
$stdout.puts "Node: #{`node --version`}"
|
12
|
+
$stdout.puts "pnpm: #{`pnpm --version`}"
|
13
|
+
|
14
|
+
$stdout.puts "\n"
|
15
|
+
$stdout.puts "@rails/webpacker: \n#{`npm list @rails/webpacker version`}"
|
16
|
+
|
17
|
+
$stdout.puts "Is bin/webpack present?: #{File.exist?("bin/webpack")}"
|
18
|
+
$stdout.puts <<~HEREDOC.squish
|
19
|
+
Is bin/webpack-dev-server present?: #{File.exist?("bin/webpack-dev-server")}
|
20
|
+
HEREDOC
|
21
|
+
end
|
22
|
+
end
|
@@ -1,14 +1,14 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
namespace :webpacker do
|
4
|
-
desc "
|
5
|
-
task pnpm_install: [:environment] do
|
6
|
-
valid_node_envs =
|
7
|
-
|
8
|
-
node_env = ENV.fetch("NODE_ENV") do
|
9
|
-
valid_node_envs.include?(Rails.env) ? Rails.env : "production"
|
10
|
-
end
|
11
|
-
|
12
|
-
system({ "NODE_ENV" => node_env }, "pnpm i --frozen-lockfile")
|
13
|
-
end
|
14
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
namespace :webpacker do
|
4
|
+
desc "Install all JavaScript dependencies as specified via pnpm."
|
5
|
+
task pnpm_install: [:environment] do
|
6
|
+
valid_node_envs = ["test", "development", "production"]
|
7
|
+
|
8
|
+
node_env = ENV.fetch("NODE_ENV") do
|
9
|
+
valid_node_envs.include?(Rails.env) ? Rails.env : "production"
|
10
|
+
end
|
11
|
+
|
12
|
+
system({ "NODE_ENV" => node_env }, "pnpm i --frozen-lockfile --shamefully-hoist")
|
13
|
+
end
|
14
|
+
end
|
data/test/rake_tasks_test.rb
CHANGED
@@ -1,106 +1,97 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "test_helper"
|
4
|
-
|
5
|
-
module Webpacker
|
6
|
-
module PNPM
|
7
|
-
class RakeTasksTest < Test
|
8
|
-
def test_rake_tasks
|
9
|
-
output = chdir_concurrent(test_path, "bundle exec rake --tasks")
|
10
|
-
assert_includes
|
11
|
-
assert_includes
|
12
|
-
assert_includes
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
assert_includes
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
cmd
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
def
|
92
|
-
File.expand_path("
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
end
|
99
|
-
|
100
|
-
def installed_node_modules(dir)
|
101
|
-
node_modules_path = File.expand_path("node_modules", dir)
|
102
|
-
Dir.entries(node_modules_path)
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "test_helper"
|
4
|
+
|
5
|
+
module Webpacker
|
6
|
+
module PNPM
|
7
|
+
class RakeTasksTest < Test
|
8
|
+
def test_rake_tasks
|
9
|
+
output = chdir_concurrent(test_path, "bundle exec rake --tasks")
|
10
|
+
assert_includes(output, "webpacker:check_pnpm")
|
11
|
+
assert_includes(output, "webpacker:pnpm_install")
|
12
|
+
assert_includes(output, "webpacker:env")
|
13
|
+
|
14
|
+
assert_not_includes(output, "webpacker:check_yarn")
|
15
|
+
assert_not_includes(output, "webpacker:yarn_install")
|
16
|
+
assert_not_includes(output, "yarn:install")
|
17
|
+
assert_not_includes(output, "webpacker:info")
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_check_pnpm_version
|
21
|
+
output = chdir_concurrent(test_path, "rake webpacker:check_pnpm")
|
22
|
+
assert_not_includes(output, "pnpm is not installed")
|
23
|
+
assert_not_includes(output, "Webpacker requires pnpm")
|
24
|
+
|
25
|
+
assert_includes(output, "Verifying pnpm version...")
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_override_check_yarn_version
|
29
|
+
output = chdir_concurrent(test_path, "rake webpacker:check_yarn")
|
30
|
+
assert_not_includes(output, "pnpm is not installed")
|
31
|
+
assert_not_includes(output, "Webpacker requires pnpm")
|
32
|
+
|
33
|
+
assert_includes(output, "Verifying pnpm version...")
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_pnpm_install_in_production_env
|
37
|
+
cmd = "bundle exec rake webpacker:pnpm_install"
|
38
|
+
chdir_concurrent(test_path, cmd, { "NODE_ENV": "production" },
|
39
|
+
{ isolated: true }) do |temp|
|
40
|
+
assert_not_includes installed_node_modules(temp), "right-pad", <<~HEREDOC
|
41
|
+
Expected only production dependencies to be installed
|
42
|
+
HEREDOC
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_pnpm_install_in_test_env
|
47
|
+
assert_includes(test_app_dev_dependencies, "right-pad")
|
48
|
+
|
49
|
+
cmd = "bundle exec rake webpacker:pnpm_install"
|
50
|
+
chdir_concurrent(test_path, cmd, { "NODE_ENV": "test" },
|
51
|
+
{ isolated: true }) do |temp|
|
52
|
+
assert_includes installed_node_modules(temp), "right-pad", <<~HEREDOC
|
53
|
+
Expected dev dependencies to be installed
|
54
|
+
HEREDOC
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_yarn_install_alias_in_production_env
|
59
|
+
cmd = "bundle exec rake webpacker:yarn_install"
|
60
|
+
chdir_concurrent(test_path, cmd, { "NODE_ENV": "production" },
|
61
|
+
{ isolated: true }) do |temp|
|
62
|
+
assert_not_includes installed_node_modules(temp), "right-pad", <<~HEREDOC
|
63
|
+
Expected only production dependencies to be installed
|
64
|
+
HEREDOC
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_yarn_install_alias_in_test_env
|
69
|
+
assert_includes(test_app_dev_dependencies, "right-pad")
|
70
|
+
|
71
|
+
cmd = "bundle exec rake webpacker:yarn_install"
|
72
|
+
chdir_concurrent(test_path, cmd, { "NODE_ENV": "test" },
|
73
|
+
{ isolated: true }) do |temp|
|
74
|
+
assert_includes installed_node_modules(temp), "right-pad", <<~HEREDOC
|
75
|
+
Expected dev dependencies to be installed
|
76
|
+
HEREDOC
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
private
|
81
|
+
|
82
|
+
def test_path
|
83
|
+
File.expand_path("test_app", __dir__)
|
84
|
+
end
|
85
|
+
|
86
|
+
def test_app_dev_dependencies
|
87
|
+
package_json = File.expand_path("package.json", test_path)
|
88
|
+
JSON.parse(File.read(package_json))["devDependencies"]
|
89
|
+
end
|
90
|
+
|
91
|
+
def installed_node_modules(dir)
|
92
|
+
node_modules_path = File.expand_path("node_modules", dir)
|
93
|
+
Dir.entries(node_modules_path)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
data/test/test_app/.gitignore
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
/.bundle/
|
2
|
-
/coverage/
|
3
|
-
/doc/
|
4
|
-
/pkg/
|
5
|
-
/spec/reports/
|
6
|
-
/tmp/
|
1
|
+
/.bundle/
|
2
|
+
/coverage/
|
3
|
+
/doc/
|
4
|
+
/pkg/
|
5
|
+
/spec/reports/
|
6
|
+
/tmp/
|
7
7
|
/node_modules
|
data/test/test_app/Rakefile
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "config/application"
|
4
|
-
|
5
|
-
Rails.application.load_tasks
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "config/application"
|
4
|
+
|
5
|
+
Rails.application.load_tasks
|
@@ -1,10 +1,10 @@
|
|
1
|
-
/* eslint no-console:0 */
|
2
|
-
// This file is automatically compiled by Webpack, along with any other files
|
3
|
-
// present in this directory. You're encouraged to place your actual application logic in
|
4
|
-
// a relevant structure within app/javascript and only use these pack files to reference
|
5
|
-
// that code so it'll be compiled.
|
6
|
-
//
|
7
|
-
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
|
8
|
-
// layout file, like app/views/layouts/application.html.erb
|
9
|
-
|
10
|
-
console.log('"Hello Sanity" from webpacker-pnpm!')
|
1
|
+
/* eslint no-console:0 */
|
2
|
+
// This file is automatically compiled by Webpack, along with any other files
|
3
|
+
// present in this directory. You're encouraged to place your actual application logic in
|
4
|
+
// a relevant structure within app/javascript and only use these pack files to reference
|
5
|
+
// that code so it'll be compiled.
|
6
|
+
//
|
7
|
+
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
|
8
|
+
// layout file, like app/views/layouts/application.html.erb
|
9
|
+
|
10
|
+
console.log('"Hello Sanity" from webpacker-pnpm!')
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*
|
2
|
-
* Dummy file #1 for Multi File Entry points: https://webpack.js.org/guides/entry-advanced/
|
3
|
-
* This file must be named the same
|
1
|
+
/*
|
2
|
+
* Dummy file #1 for Multi File Entry points: https://webpack.js.org/guides/entry-advanced/
|
3
|
+
* This file must be named the same
|
4
4
|
*/
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*
|
2
|
-
* Dummy file #2 for Multi File Entry points: https://webpack.js.org/guides/entry-advanced/
|
3
|
-
* This file must be named the same
|
4
|
-
*/
|
1
|
+
/*
|
2
|
+
* Dummy file #2 for Multi File Entry points: https://webpack.js.org/guides/entry-advanced/
|
3
|
+
* This file must be named the same
|
4
|
+
*/
|
data/test/test_app/bin/rails
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
#!/usr/bin/env ruby.exe
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
require_relative "../config/boot"
|
6
|
-
require "rails/commands"
|
1
|
+
#!/usr/bin/env ruby.exe
|
2
|
+
APP_PATH = File.expand_path('../config/application', __dir__)
|
3
|
+
require_relative '../config/boot'
|
4
|
+
require 'rails/commands'
|
data/test/test_app/bin/rake
CHANGED
data/test/test_app/bin/setup
CHANGED
@@ -1,27 +1,25 @@
|
|
1
|
-
#!/usr/bin/env ruby.exe
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
#
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
system! "bin/rails restart"
|
27
|
-
end
|
1
|
+
#!/usr/bin/env ruby.exe
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
# path to your application root.
|
5
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
6
|
+
|
7
|
+
def system!(*args)
|
8
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
9
|
+
end
|
10
|
+
|
11
|
+
FileUtils.chdir APP_ROOT do
|
12
|
+
# This script is a way to setup or update your development environment automatically.
|
13
|
+
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
|
14
|
+
# Add necessary setup steps to this file.
|
15
|
+
|
16
|
+
puts '== Installing dependencies =='
|
17
|
+
system! 'gem install bundler --conservative'
|
18
|
+
system('bundle check') || system!('bundle install')
|
19
|
+
|
20
|
+
puts "\n== Removing old logs and tempfiles =="
|
21
|
+
system! 'bin/rails log:clear tmp:clear'
|
22
|
+
|
23
|
+
puts "\n== Restarting application server =="
|
24
|
+
system! 'bin/rails restart'
|
25
|
+
end
|
data/test/test_app/bin/webpack
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
5
|
-
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
|
6
|
-
|
7
|
-
require "pathname"
|
8
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
require "webpacker
|
14
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
5
|
+
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
|
6
|
+
|
7
|
+
require "pathname"
|
8
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
9
|
+
Pathname.new(__FILE__).realpath)
|
10
|
+
|
11
|
+
require "bundler/setup"
|
12
|
+
|
13
|
+
require "webpacker"
|
14
|
+
require "webpacker/webpack_runner"
|
15
|
+
Webpacker::WebpackRunner.run(ARGV)
|
@@ -1,14 +1,15 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
5
|
-
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
|
6
|
-
|
7
|
-
require "pathname"
|
8
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
require "webpacker
|
14
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
5
|
+
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
|
6
|
+
|
7
|
+
require "pathname"
|
8
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
9
|
+
Pathname.new(__FILE__).realpath)
|
10
|
+
|
11
|
+
require "bundler/setup"
|
12
|
+
|
13
|
+
require "webpacker"
|
14
|
+
require "webpacker/dev_server_runner"
|
15
|
+
Webpacker::DevServerRunner.run(ARGV)
|