shakapacker 8.0.0 → 8.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/dummy.yml +1 -1
- data/.github/workflows/generator.yml +5 -1
- data/.github/workflows/node.yml +1 -1
- data/.github/workflows/ruby.yml +8 -2
- data/.gitignore +0 -1
- data/.node-version +1 -1
- data/CHANGELOG.md +27 -11
- data/Gemfile.lock +257 -0
- data/README.md +11 -12
- data/__mocks__/nonexistent/package.json +4 -0
- data/__mocks__/sass-loader/package.json +4 -0
- data/docs/customizing_babel_config.md +32 -4
- data/docs/react.md +3 -2
- data/docs/troubleshooting.md +1 -1
- data/docs/using_esbuild_loader.md +1 -1
- data/docs/v8_upgrade.md +2 -2
- data/jest.config.js +2 -1
- data/lib/shakapacker/version.rb +1 -1
- data/package/rules/sass.js +8 -6
- data/package/utils/helpers.js +9 -1
- data/package.json +2 -2
- data/shakapacker.gemspec +5 -2
- data/test/package/development.test.js +9 -0
- data/test/package/environments/base.test.js +9 -0
- data/test/package/environments/development.test.js +9 -0
- data/test/package/environments/production.test.js +9 -0
- data/test/package/helpers.test.js +11 -0
- data/test/package/index.test.js +9 -0
- data/test/package/production.test.js +9 -0
- data/test/package/rules/index.test.js +9 -0
- data/test/package/rules/sass.test.js +23 -0
- data/test/package/rules/sass1.test.js +23 -0
- data/test/package/staging.test.js +9 -0
- data/test/package/test.test.js +9 -0
- data/test/resolver.js +13 -0
- metadata +15 -235
- data/lib/install/bin/yarn +0 -18
- data/rakelib/release.rake +0 -65
- data/spec/dummy/.browserslistrc +0 -1
- data/spec/dummy/.gitignore +0 -20
- data/spec/dummy/.prettierrc.yaml +0 -4
- data/spec/dummy/Gemfile +0 -61
- data/spec/dummy/Procfile.dev +0 -5
- data/spec/dummy/Procfile.dev-static +0 -9
- data/spec/dummy/README.md +0 -1
- data/spec/dummy/Rakefile +0 -6
- data/spec/dummy/app/assets/config/manifest.js +0 -2
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy/app/channels/application_cable/channel.rb +0 -4
- data/spec/dummy/app/channels/application_cable/connection.rb +0 -4
- data/spec/dummy/app/controllers/application_controller.rb +0 -2
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/controllers/hello_world_controller.rb +0 -9
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/javascript/Globals.d.ts +0 -3
- data/spec/dummy/app/javascript/bundles/HelloWorld/components/HelloWorld.module.css +0 -25
- data/spec/dummy/app/javascript/bundles/HelloWorld/components/HelloWorld.tsx +0 -47
- data/spec/dummy/app/javascript/bundles/HelloWorld/components/HelloWorldServer.tsx +0 -5
- data/spec/dummy/app/javascript/bundles/HelloWorld/components/logo.svg +0 -7
- data/spec/dummy/app/javascript/packs/application.js +0 -17
- data/spec/dummy/app/javascript/packs/hello-world-bundle.ts +0 -8
- data/spec/dummy/app/javascript/packs/server-bundle.ts +0 -8
- data/spec/dummy/app/jobs/application_job.rb +0 -7
- data/spec/dummy/app/mailers/application_mailer.rb +0 -4
- data/spec/dummy/app/models/application_record.rb +0 -3
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/views/hello_world/index.html.erb +0 -2
- data/spec/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy/app/views/layouts/hello_world.html.erb +0 -13
- data/spec/dummy/app/views/layouts/mailer.html.erb +0 -13
- data/spec/dummy/app/views/layouts/mailer.text.erb +0 -1
- data/spec/dummy/babel.config.js +0 -30
- data/spec/dummy/bin/bundle +0 -114
- data/spec/dummy/bin/dev +0 -30
- data/spec/dummy/bin/dev-static +0 -30
- data/spec/dummy/bin/rails +0 -9
- data/spec/dummy/bin/rake +0 -9
- data/spec/dummy/bin/setup +0 -33
- data/spec/dummy/bin/shakapacker +0 -13
- data/spec/dummy/bin/shakapacker-dev-server +0 -13
- data/spec/dummy/bin/spring +0 -17
- data/spec/dummy/bin/yarn +0 -18
- data/spec/dummy/config/application.rb +0 -35
- data/spec/dummy/config/boot.rb +0 -4
- data/spec/dummy/config/cable.yml +0 -10
- data/spec/dummy/config/credentials.yml.enc +0 -1
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -54
- data/spec/dummy/config/environments/production.rb +0 -106
- data/spec/dummy/config/environments/test.rb +0 -49
- data/spec/dummy/config/initializers/application_controller_renderer.rb +0 -8
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/content_security_policy.rb +0 -28
- data/spec/dummy/config/initializers/cookies_serializer.rb +0 -5
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy/config/initializers/inflections.rb +0 -16
- data/spec/dummy/config/initializers/mime_types.rb +0 -4
- data/spec/dummy/config/initializers/react_on_rails.rb +0 -58
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/en.yml +0 -33
- data/spec/dummy/config/puma.rb +0 -38
- data/spec/dummy/config/routes.rb +0 -6
- data/spec/dummy/config/shakapacker.yml +0 -61
- data/spec/dummy/config/spring.rb +0 -6
- data/spec/dummy/config/storage.yml +0 -34
- data/spec/dummy/config/webpack/ServerClientOrBoth.js +0 -34
- data/spec/dummy/config/webpack/clientWebpackConfig.js +0 -15
- data/spec/dummy/config/webpack/commonWebpackConfig.js +0 -17
- data/spec/dummy/config/webpack/development.js +0 -32
- data/spec/dummy/config/webpack/production.js +0 -9
- data/spec/dummy/config/webpack/serverWebpackConfig.js +0 -116
- data/spec/dummy/config/webpack/test.js +0 -7
- data/spec/dummy/config/webpack/webpack.config.js +0 -24
- data/spec/dummy/config.ru +0 -5
- data/spec/dummy/db/seeds.rb +0 -7
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/lib/tasks/.keep +0 -0
- data/spec/dummy/package.json +0 -44
- data/spec/dummy/postcss.config.js +0 -12
- data/spec/dummy/public/404.html +0 -67
- data/spec/dummy/public/422.html +0 -67
- data/spec/dummy/public/500.html +0 -66
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/robots.txt +0 -1
- data/spec/dummy/spec/rails_helper.rb +0 -118
- data/spec/dummy/spec/spec_helper.rb +0 -96
- data/spec/dummy/spec/system/hello_world_spec.rb +0 -19
- data/spec/dummy/tsconfig.json +0 -21
- data/spec/dummy/vendor/.keep +0 -0
- data/spec/dummy/yarn.lock +0 -4696
- data/spec/fixtures/beta_package-lock.v1.json +0 -119
- data/spec/fixtures/beta_package-lock.v2.json +0 -6777
- data/spec/fixtures/beta_package.json +0 -13
- data/spec/fixtures/beta_pnpm-lock.v7.yaml +0 -116
- data/spec/fixtures/beta_pnpm-lock.v8.yaml +0 -2537
- data/spec/fixtures/beta_pnpm-lock.v9.yaml +0 -2885
- data/spec/fixtures/beta_yarn.v1.lock +0 -106
- data/spec/fixtures/beta_yarn.v2.lock +0 -164
- data/spec/fixtures/git_url_package-lock.v1.json +0 -118
- data/spec/fixtures/git_url_package-lock.v2.json +0 -10263
- data/spec/fixtures/git_url_package.json +0 -13
- data/spec/fixtures/git_url_pnpm-lock.v7.yaml +0 -126
- data/spec/fixtures/git_url_pnpm-lock.v8.yaml +0 -3728
- data/spec/fixtures/git_url_pnpm-lock.v9.yaml +0 -4544
- data/spec/fixtures/git_url_yarn.v1.lock +0 -106
- data/spec/fixtures/git_url_yarn.v2.lock +0 -165
- data/spec/fixtures/github_url_package-lock.v1.json +0 -118
- data/spec/fixtures/github_url_package-lock.v2.json +0 -10263
- data/spec/fixtures/github_url_package.json +0 -13
- data/spec/fixtures/github_url_pnpm-lock.v7.yaml +0 -126
- data/spec/fixtures/github_url_pnpm-lock.v8.yaml +0 -3728
- data/spec/fixtures/github_url_pnpm-lock.v9.yaml +0 -4544
- data/spec/fixtures/github_url_yarn.v1.lock +0 -105
- data/spec/fixtures/github_url_yarn.v2.lock +0 -165
- data/spec/fixtures/relative_path_package-lock.v1.json +0 -3468
- data/spec/fixtures/relative_path_package-lock.v2.json +0 -105
- data/spec/fixtures/relative_path_package.json +0 -13
- data/spec/fixtures/relative_path_pnpm-lock.v7.yaml +0 -18
- data/spec/fixtures/relative_path_pnpm-lock.v8.yaml +0 -22
- data/spec/fixtures/relative_path_pnpm-lock.v9.yaml +0 -28
- data/spec/fixtures/relative_path_yarn.v1.lock +0 -104
- data/spec/fixtures/relative_path_yarn.v2.lock +0 -165
- data/spec/fixtures/semver_caret_package-lock.v1.json +0 -119
- data/spec/fixtures/semver_caret_package-lock.v2.json +0 -10264
- data/spec/fixtures/semver_caret_package.json +0 -13
- data/spec/fixtures/semver_caret_pnpm-lock.v7.yaml +0 -117
- data/spec/fixtures/semver_caret_pnpm-lock.v8.yaml +0 -2558
- data/spec/fixtures/semver_caret_pnpm-lock.v9.yaml +0 -4285
- data/spec/fixtures/semver_caret_yarn.v1.lock +0 -106
- data/spec/fixtures/semver_caret_yarn.v2.lock +0 -165
- data/spec/fixtures/semver_exact_package-lock.v1.json +0 -119
- data/spec/fixtures/semver_exact_package-lock.v2.json +0 -6819
- data/spec/fixtures/semver_exact_package.json +0 -13
- data/spec/fixtures/semver_exact_pnpm-lock.v7.yaml +0 -117
- data/spec/fixtures/semver_exact_pnpm-lock.v8.yaml +0 -2558
- data/spec/fixtures/semver_exact_pnpm-lock.v9.yaml +0 -2908
- data/spec/fixtures/semver_exact_yarn.v1.lock +0 -106
- data/spec/fixtures/semver_exact_yarn.v2.lock +0 -165
- data/spec/fixtures/semver_tilde_package-lock.v1.json +0 -119
- data/spec/fixtures/semver_tilde_package-lock.v2.json +0 -6777
- data/spec/fixtures/semver_tilde_package.json +0 -13
- data/spec/fixtures/semver_tilde_pnpm-lock.v7.yaml +0 -116
- data/spec/fixtures/semver_tilde_pnpm-lock.v8.yaml +0 -2558
- data/spec/fixtures/semver_tilde_pnpm-lock.v9.yaml +0 -2885
- data/spec/fixtures/semver_tilde_yarn.v1.lock +0 -106
- data/spec/fixtures/semver_tilde_yarn.v2.lock +0 -164
- data/spec/fixtures/without_package-lock.v1.json +0 -19
- data/spec/fixtures/without_package-lock.v2.json +0 -47
- data/spec/fixtures/without_package.json +0 -13
- data/spec/fixtures/without_pnpm-lock.v7.yaml +0 -23
- data/spec/fixtures/without_pnpm-lock.v8.yaml +0 -27
- data/spec/fixtures/without_pnpm-lock.v9.yaml +0 -34
- data/spec/fixtures/without_yarn.v1.lock +0 -13
- data/spec/fixtures/without_yarn.v2.lock +0 -29
- data/spec/generator_specs/e2e_template/files/app/controllers/home_controller.rb +0 -4
- data/spec/generator_specs/e2e_template/files/app/javascript/components/App.js +0 -12
- data/spec/generator_specs/e2e_template/files/app/javascript/packs/application.js +0 -10
- data/spec/generator_specs/e2e_template/files/app/views/home/index.html.erb +0 -2
- data/spec/generator_specs/e2e_template/files/app/views/layouts/application.html.erb +0 -17
- data/spec/generator_specs/e2e_template/files/config/routes.rb +0 -3
- data/spec/generator_specs/e2e_template/files/spec/system/test_react_component_renders_spec.rb +0 -13
- data/spec/generator_specs/e2e_template/template.rb +0 -29
- data/spec/generator_specs/fake-bin/bun +0 -10
- data/spec/generator_specs/fake-bin/npm +0 -10
- data/spec/generator_specs/fake-bin/pnpm +0 -10
- data/spec/generator_specs/fake-bin/yarn +0 -10
- data/spec/generator_specs/generator_spec.rb +0 -193
- data/spec/mounted_app/Rakefile +0 -4
- data/spec/mounted_app/package.json +0 -1
- data/spec/mounted_app/test/dummy/Rakefile +0 -3
- data/spec/mounted_app/test/dummy/bin/rails +0 -3
- data/spec/mounted_app/test/dummy/bin/rake +0 -3
- data/spec/mounted_app/test/dummy/config/application.rb +0 -10
- data/spec/mounted_app/test/dummy/config/environment.rb +0 -3
- data/spec/mounted_app/test/dummy/config/webpacker.yml +0 -81
- data/spec/mounted_app/test/dummy/config.ru +0 -5
- data/spec/mounted_app/test/dummy/package.json +0 -7
- data/spec/shakapacker/command_spec.rb +0 -134
- data/spec/shakapacker/compiler_spec.rb +0 -57
- data/spec/shakapacker/compiler_strategy_spec.rb +0 -24
- data/spec/shakapacker/configuration_spec.rb +0 -377
- data/spec/shakapacker/dev_server_runner_spec.rb +0 -136
- data/spec/shakapacker/dev_server_spec.rb +0 -118
- data/spec/shakapacker/digest_strategy_spec.rb +0 -59
- data/spec/shakapacker/engine_rake_tasks_spec.rb +0 -50
- data/spec/shakapacker/env_spec.rb +0 -23
- data/spec/shakapacker/helper_spec.rb +0 -243
- data/spec/shakapacker/instance_spec.rb +0 -29
- data/spec/shakapacker/manifest_spec.rb +0 -100
- data/spec/shakapacker/mtime_strategy_spec.rb +0 -55
- data/spec/shakapacker/rake_tasks_spec.rb +0 -85
- data/spec/shakapacker/shakapacker_spec.rb +0 -40
- data/spec/shakapacker/spec_helper_initializer.rb +0 -24
- data/spec/shakapacker/test_app/.gitignore +0 -2
- data/spec/shakapacker/test_app/Rakefile +0 -3
- data/spec/shakapacker/test_app/app/javascript/entrypoints/application.js +0 -10
- data/spec/shakapacker/test_app/app/javascript/entrypoints/generated/something.js +0 -2
- data/spec/shakapacker/test_app/app/javascript/entrypoints/multi_entry.css +0 -4
- data/spec/shakapacker/test_app/app/javascript/entrypoints/multi_entry.js +0 -4
- data/spec/shakapacker/test_app/bin/shakapacker +0 -14
- data/spec/shakapacker/test_app/bin/shakapacker-dev-server +0 -14
- data/spec/shakapacker/test_app/config/application.rb +0 -11
- data/spec/shakapacker/test_app/config/environment.rb +0 -4
- data/spec/shakapacker/test_app/config/initializers/inspect_autoload_paths.rb +0 -1
- data/spec/shakapacker/test_app/config/shakapacker.yml +0 -82
- data/spec/shakapacker/test_app/config/shakapacker_css_extract_ignore_order_warnings.yml +0 -83
- data/spec/shakapacker/test_app/config/shakapacker_defaults_fallback.yml +0 -11
- data/spec/shakapacker/test_app/config/shakapacker_manifest_path.yml +0 -79
- data/spec/shakapacker/test_app/config/shakapacker_nested_entries.yml +0 -82
- data/spec/shakapacker/test_app/config/shakapacker_no_precompile.yml +0 -7
- data/spec/shakapacker/test_app/config/shakapacker_other_location.yml +0 -84
- data/spec/shakapacker/test_app/config/shakapacker_public_root.yml +0 -18
- data/spec/shakapacker/test_app/config/webpack/webpack.config.js +0 -0
- data/spec/shakapacker/test_app/config.ru +0 -5
- data/spec/shakapacker/test_app/package.json +0 -14
- data/spec/shakapacker/test_app/public/packs/manifest.json +0 -58
- data/spec/shakapacker/test_app/some.config.js +0 -0
- data/spec/shakapacker/test_app/yarn.lock +0 -11
- data/spec/shakapacker/utils_manager_spec.rb +0 -125
- data/spec/shakapacker/version_checker_spec.rb +0 -1469
- data/spec/shakapacker/webpack_runner_spec.rb +0 -76
- data/spec/spec_helper.rb +0 -100
- data/spec/support/package_json_helpers.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db9b65b6bcad3c69564cc6e9a1c81ef86586b551cceac4426ff4648388943063
|
4
|
+
data.tar.gz: 764219a7ff3a435f16bf8554f538f56b5d32f29e1849cdf06241504098b5f9c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b45a4a37953a95d40eeaa8382350991058e074157594a8eeb977eace38db31d0c2507db9aec61eb8eea20485e135d68e9e9d688fc8fe094f4672532715ecc01
|
7
|
+
data.tar.gz: b053d207e3e1d56ab2e92987d216212f75e4b6d41d49d6b5bed1ccfdb29d917b94ac4d17220f607253ffc9d335de733089deb1e5aca44dc389a6177168e244da
|
data/.github/workflows/dummy.yml
CHANGED
@@ -18,7 +18,7 @@ jobs:
|
|
18
18
|
strategy:
|
19
19
|
matrix:
|
20
20
|
os: [ubuntu-latest]
|
21
|
-
ruby: ['2.7', '3.0', '3.1', '3.2']
|
21
|
+
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
|
22
22
|
gemfile:
|
23
23
|
- gemfiles/Gemfile-rails.6.0.x
|
24
24
|
- gemfiles/Gemfile-rails.6.1.x
|
@@ -32,6 +32,10 @@ jobs:
|
|
32
32
|
gemfile: gemfiles/Gemfile-rails.6.0.x
|
33
33
|
- ruby: '3.2'
|
34
34
|
gemfile: gemfiles/Gemfile-rails.6.0.x
|
35
|
+
- ruby: '3.3'
|
36
|
+
gemfile: gemfiles/Gemfile-rails.6.0.x
|
37
|
+
- ruby: '3.3'
|
38
|
+
gemfile: gemfiles/Gemfile-rails.6.1.x
|
35
39
|
|
36
40
|
env:
|
37
41
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
data/.github/workflows/node.yml
CHANGED
data/.github/workflows/ruby.yml
CHANGED
@@ -19,9 +19,11 @@ jobs:
|
|
19
19
|
- uses: actions/checkout@v4
|
20
20
|
with:
|
21
21
|
persist-credentials: false
|
22
|
+
- name: Remove Gemfile.lock
|
23
|
+
run: rm -f Gemfile.lock
|
22
24
|
- uses: ruby/setup-ruby@v1
|
23
25
|
with:
|
24
|
-
ruby-version: '3.
|
26
|
+
ruby-version: '3.3'
|
25
27
|
bundler-cache: true
|
26
28
|
|
27
29
|
- name: Ruby rubocop
|
@@ -33,7 +35,7 @@ jobs:
|
|
33
35
|
strategy:
|
34
36
|
matrix:
|
35
37
|
os: [ubuntu-latest]
|
36
|
-
ruby: ['2.7', '3.0', '3.1', '3.2']
|
38
|
+
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
|
37
39
|
gemfile:
|
38
40
|
- gemfiles/Gemfile-rails.6.0.x
|
39
41
|
- gemfiles/Gemfile-rails.6.1.x
|
@@ -47,6 +49,10 @@ jobs:
|
|
47
49
|
gemfile: gemfiles/Gemfile-rails.6.0.x
|
48
50
|
- ruby: '3.2'
|
49
51
|
gemfile: gemfiles/Gemfile-rails.6.0.x
|
52
|
+
- ruby: '3.3'
|
53
|
+
gemfile: gemfiles/Gemfile-rails.6.0.x
|
54
|
+
- ruby: '3.3'
|
55
|
+
gemfile: gemfiles/Gemfile-rails.6.1.x
|
50
56
|
|
51
57
|
env:
|
52
58
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
data/.gitignore
CHANGED
data/.node-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
22.2.0
|
data/CHANGELOG.md
CHANGED
@@ -10,24 +10,38 @@ _next_ branch is for v8 changes
|
|
10
10
|
## [Unreleased]
|
11
11
|
Changes since the last non-beta release.
|
12
12
|
|
13
|
-
###
|
14
|
-
|
13
|
+
### Changed
|
14
|
+
|
15
|
+
- Fix wrong instruction in esbuild loader documentation [PR 504](https://github.com/shakacode/shakapacker/pull/504) by [adriangohjw](https://github.com/adriangohjw)
|
16
|
+
|
17
|
+
## [v8.0.1] - July 10, 2024
|
15
18
|
|
16
|
-
|
19
|
+
### Changed
|
20
|
+
- Update outdated GitHub Actions to use Node.js 20.0 versions instead [PR 497](https://github.com/shakacode/shakapacker/pull/497) by [adriangohjw](https://github.com/adriangohjw).
|
21
|
+
- Allow `webpack-merge` v6 to be used [PR 502](https://github.com/shakacode/shakapacker/pull/502) by [G-Rath](https://github.com/g-rath).
|
17
22
|
|
18
23
|
### Fixed
|
19
24
|
|
20
|
-
- Fixes
|
25
|
+
- Fixes failing tests for Ruby 2.7 due to `Rack::Handler::Puma.respond_to?(:config)` [PR 501](https://github.com/shakacode/shakapacker/pull/501) by [adriangohjw](https://github.com/adriangohjw)
|
26
|
+
|
27
|
+
- Improve documentation for using Yarn PnP [PR 484](https://github.com/shakacode/shakapacker/pull/484) by [G-Rath](https://github.com/g-rath).
|
28
|
+
|
29
|
+
- Remove old `yarn` bin script [PR 483](https://github.com/shakacode/shakapacker/pull/483) by [G-Rath](https://github.com/g-rath).
|
21
30
|
|
22
|
-
## [v8.0.0
|
31
|
+
## [v8.0.0] - May 17, 2024
|
32
|
+
|
33
|
+
See the [v8 Upgrade Guide](https://github.com/shakacode/shakapacker/blob/main/docs/v8_upgrade.md).
|
23
34
|
|
24
35
|
### Fixed
|
25
36
|
|
26
|
-
-
|
37
|
+
- Fixes incorrect removal of files in the assets:clean task [PR 474](https://github.com/shakacode/shakapacker/pull/474) by [tomdracz](https://github.com/tomdracz).
|
27
38
|
|
28
|
-
|
39
|
+
- Support v9 PNPM lockfiles [PR 472](https://github.com/shakacode/shakapacker/pull/472) by [G-Rath](https://github.com/g-rath).
|
29
40
|
|
30
41
|
### Breaking changes
|
42
|
+
|
43
|
+
- Removes CDN url from the manifest.json paths. [PR 473](https://github.com/shakacode/shakapacker/pull/473) by [tomdracz](https://github.com/tomdracz). This returns to the Webpacker behaviour prior to the aborted Webpacker v6.
|
44
|
+
|
31
45
|
- Remove `relative_url_root` [PR 413](https://github.com/shakacode/shakapacker/pull/413) by [G-Rath](https://github.com/g-rath).
|
32
46
|
|
33
47
|
- Removes deprecated support of `Webpacker` spelling, config variables and constants. [PR 429](https://github.com/shakacode/shakapacker/pull/429) by [tomdracz](https://github.com/tomdracz).
|
@@ -43,6 +57,8 @@ Changes since the last non-beta release.
|
|
43
57
|
This enables support for package managers other than `yarn`, with `npm` being the default; to continue using Yarn,
|
44
58
|
specify it in `package.json` using the [`packageManager`](https://nodejs.org/api/packages.html#packagemanager) property.
|
45
59
|
|
60
|
+
This also removed `@node_modules_bin_path`, `SHAKAPACKER_NODE_MODULES_BIN_PATH`, and support for installing `Shakapacker`'s javascript package in a separate directory from the Gemfile containing `Shakapacker`'s ruby gem.
|
61
|
+
|
46
62
|
- Remove `yarn_install` rake task, and stop installing js packages automatically as part of `assets:precompile` [PR 412](https://github.com/shakacode/shakapacker/pull/412) by [G-Rath](https://github.com/g-rath).
|
47
63
|
|
48
64
|
- Remove `check_yarn` rake task [PR 443](https://github.com/shakacode/shakapacker/pull/443) by [G-Rath](https://github.com/g-rath).
|
@@ -345,7 +361,7 @@ Note: [Rubygem is 6.3.0.pre.rc.1](https://rubygems.org/gems/shakapacker/versions
|
|
345
361
|
## [v6.0.0.rc.6 changes from v5.4] - Forked January 16, 2022
|
346
362
|
|
347
363
|
|
348
|
-
- `node_modules` will no longer be babel
|
364
|
+
- `node_modules` will no longer be babel transformed compiled by default. This primarily fixes [rails issue #35501](https://github.com/rails/rails/issues/35501) as well as [numerous other webpacker issues](https://github.com/rails/webpacker/issues/2131#issuecomment-581618497). The disabled loader can still be required explicitly via:
|
349
365
|
|
350
366
|
```js
|
351
367
|
const nodeModules = require('@rails/webpacker/rules/node_modules.js')
|
@@ -370,9 +386,9 @@ Note: [Rubygem is 6.3.0.pre.rc.1](https://rubygems.org/gems/shakapacker/versions
|
|
370
386
|
## v5.4.3 and prior changes from rails/webpacker
|
371
387
|
See [CHANGELOG.md in rails/webpacker (up to v5.4.3)](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
|
372
388
|
|
373
|
-
[Unreleased]: https://github.com/shakacode/shakapacker/compare/v8.0.
|
374
|
-
[v8.0.
|
375
|
-
[v8.0.0
|
389
|
+
[Unreleased]: https://github.com/shakacode/shakapacker/compare/v8.0.1...main
|
390
|
+
[v8.0.1]: https://github.com/shakacode/shakapacker/compare/v8.0.0...v8.0.1
|
391
|
+
[v8.0.0]: https://github.com/shakacode/shakapacker/compare/v7.2.3...v8.0.0
|
376
392
|
[v7.2.3]: https://github.com/shakacode/shakapacker/compare/v7.2.2...v7.2.3
|
377
393
|
[v7.2.2]: https://github.com/shakacode/shakapacker/compare/v7.2.1...v7.2.2
|
378
394
|
[v7.2.1]: https://github.com/shakacode/shakapacker/compare/v7.2.0...v7.2.1
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,257 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
shakapacker (8.0.2)
|
5
|
+
activesupport (>= 5.2)
|
6
|
+
package_json
|
7
|
+
rack-proxy (>= 0.6.1)
|
8
|
+
railties (>= 5.2)
|
9
|
+
semantic_range (>= 2.3.0)
|
10
|
+
|
11
|
+
GEM
|
12
|
+
remote: https://rubygems.org/
|
13
|
+
specs:
|
14
|
+
actioncable (7.1.3.4)
|
15
|
+
actionpack (= 7.1.3.4)
|
16
|
+
activesupport (= 7.1.3.4)
|
17
|
+
nio4r (~> 2.0)
|
18
|
+
websocket-driver (>= 0.6.1)
|
19
|
+
zeitwerk (~> 2.6)
|
20
|
+
actionmailbox (7.1.3.4)
|
21
|
+
actionpack (= 7.1.3.4)
|
22
|
+
activejob (= 7.1.3.4)
|
23
|
+
activerecord (= 7.1.3.4)
|
24
|
+
activestorage (= 7.1.3.4)
|
25
|
+
activesupport (= 7.1.3.4)
|
26
|
+
mail (>= 2.7.1)
|
27
|
+
net-imap
|
28
|
+
net-pop
|
29
|
+
net-smtp
|
30
|
+
actionmailer (7.1.3.4)
|
31
|
+
actionpack (= 7.1.3.4)
|
32
|
+
actionview (= 7.1.3.4)
|
33
|
+
activejob (= 7.1.3.4)
|
34
|
+
activesupport (= 7.1.3.4)
|
35
|
+
mail (~> 2.5, >= 2.5.4)
|
36
|
+
net-imap
|
37
|
+
net-pop
|
38
|
+
net-smtp
|
39
|
+
rails-dom-testing (~> 2.2)
|
40
|
+
actionpack (7.1.3.4)
|
41
|
+
actionview (= 7.1.3.4)
|
42
|
+
activesupport (= 7.1.3.4)
|
43
|
+
nokogiri (>= 1.8.5)
|
44
|
+
racc
|
45
|
+
rack (>= 2.2.4)
|
46
|
+
rack-session (>= 1.0.1)
|
47
|
+
rack-test (>= 0.6.3)
|
48
|
+
rails-dom-testing (~> 2.2)
|
49
|
+
rails-html-sanitizer (~> 1.6)
|
50
|
+
actiontext (7.1.3.4)
|
51
|
+
actionpack (= 7.1.3.4)
|
52
|
+
activerecord (= 7.1.3.4)
|
53
|
+
activestorage (= 7.1.3.4)
|
54
|
+
activesupport (= 7.1.3.4)
|
55
|
+
globalid (>= 0.6.0)
|
56
|
+
nokogiri (>= 1.8.5)
|
57
|
+
actionview (7.1.3.4)
|
58
|
+
activesupport (= 7.1.3.4)
|
59
|
+
builder (~> 3.1)
|
60
|
+
erubi (~> 1.11)
|
61
|
+
rails-dom-testing (~> 2.2)
|
62
|
+
rails-html-sanitizer (~> 1.6)
|
63
|
+
activejob (7.1.3.4)
|
64
|
+
activesupport (= 7.1.3.4)
|
65
|
+
globalid (>= 0.3.6)
|
66
|
+
activemodel (7.1.3.4)
|
67
|
+
activesupport (= 7.1.3.4)
|
68
|
+
activerecord (7.1.3.4)
|
69
|
+
activemodel (= 7.1.3.4)
|
70
|
+
activesupport (= 7.1.3.4)
|
71
|
+
timeout (>= 0.4.0)
|
72
|
+
activestorage (7.1.3.4)
|
73
|
+
actionpack (= 7.1.3.4)
|
74
|
+
activejob (= 7.1.3.4)
|
75
|
+
activerecord (= 7.1.3.4)
|
76
|
+
activesupport (= 7.1.3.4)
|
77
|
+
marcel (~> 1.0)
|
78
|
+
activesupport (7.1.3.4)
|
79
|
+
base64
|
80
|
+
bigdecimal
|
81
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
82
|
+
connection_pool (>= 2.2.5)
|
83
|
+
drb
|
84
|
+
i18n (>= 1.6, < 2)
|
85
|
+
minitest (>= 5.1)
|
86
|
+
mutex_m
|
87
|
+
tzinfo (~> 2.0)
|
88
|
+
ast (2.4.2)
|
89
|
+
base64 (0.2.0)
|
90
|
+
bigdecimal (3.1.8)
|
91
|
+
builder (3.3.0)
|
92
|
+
byebug (11.1.3)
|
93
|
+
concurrent-ruby (1.3.3)
|
94
|
+
connection_pool (2.4.1)
|
95
|
+
crass (1.0.6)
|
96
|
+
date (3.3.4)
|
97
|
+
diff-lcs (1.5.1)
|
98
|
+
drb (2.2.1)
|
99
|
+
erubi (1.13.0)
|
100
|
+
globalid (1.2.1)
|
101
|
+
activesupport (>= 6.1)
|
102
|
+
i18n (1.14.5)
|
103
|
+
concurrent-ruby (~> 1.0)
|
104
|
+
io-console (0.7.2)
|
105
|
+
irb (1.14.0)
|
106
|
+
rdoc (>= 4.0.0)
|
107
|
+
reline (>= 0.4.2)
|
108
|
+
json (2.7.2)
|
109
|
+
language_server-protocol (3.17.0.3)
|
110
|
+
loofah (2.22.0)
|
111
|
+
crass (~> 1.0.2)
|
112
|
+
nokogiri (>= 1.12.0)
|
113
|
+
mail (2.8.1)
|
114
|
+
mini_mime (>= 0.1.1)
|
115
|
+
net-imap
|
116
|
+
net-pop
|
117
|
+
net-smtp
|
118
|
+
marcel (1.0.4)
|
119
|
+
mini_mime (1.1.5)
|
120
|
+
mini_portile2 (2.8.7)
|
121
|
+
minitest (5.24.1)
|
122
|
+
mutex_m (0.2.0)
|
123
|
+
net-imap (0.4.14)
|
124
|
+
date
|
125
|
+
net-protocol
|
126
|
+
net-pop (0.1.2)
|
127
|
+
net-protocol
|
128
|
+
net-protocol (0.2.2)
|
129
|
+
timeout
|
130
|
+
net-smtp (0.5.0)
|
131
|
+
net-protocol
|
132
|
+
nio4r (2.7.3)
|
133
|
+
nokogiri (1.16.6)
|
134
|
+
mini_portile2 (~> 2.8.2)
|
135
|
+
racc (~> 1.4)
|
136
|
+
package_json (0.1.0)
|
137
|
+
parallel (1.25.1)
|
138
|
+
parser (3.3.3.0)
|
139
|
+
ast (~> 2.4.1)
|
140
|
+
racc
|
141
|
+
psych (5.1.2)
|
142
|
+
stringio
|
143
|
+
racc (1.8.0)
|
144
|
+
rack (3.1.6)
|
145
|
+
rack-proxy (0.7.7)
|
146
|
+
rack
|
147
|
+
rack-session (2.0.0)
|
148
|
+
rack (>= 3.0.0)
|
149
|
+
rack-test (2.1.0)
|
150
|
+
rack (>= 1.3)
|
151
|
+
rackup (2.1.0)
|
152
|
+
rack (>= 3)
|
153
|
+
webrick (~> 1.8)
|
154
|
+
rails (7.1.3.4)
|
155
|
+
actioncable (= 7.1.3.4)
|
156
|
+
actionmailbox (= 7.1.3.4)
|
157
|
+
actionmailer (= 7.1.3.4)
|
158
|
+
actionpack (= 7.1.3.4)
|
159
|
+
actiontext (= 7.1.3.4)
|
160
|
+
actionview (= 7.1.3.4)
|
161
|
+
activejob (= 7.1.3.4)
|
162
|
+
activemodel (= 7.1.3.4)
|
163
|
+
activerecord (= 7.1.3.4)
|
164
|
+
activestorage (= 7.1.3.4)
|
165
|
+
activesupport (= 7.1.3.4)
|
166
|
+
bundler (>= 1.15.0)
|
167
|
+
railties (= 7.1.3.4)
|
168
|
+
rails-dom-testing (2.2.0)
|
169
|
+
activesupport (>= 5.0.0)
|
170
|
+
minitest
|
171
|
+
nokogiri (>= 1.6)
|
172
|
+
rails-html-sanitizer (1.6.0)
|
173
|
+
loofah (~> 2.21)
|
174
|
+
nokogiri (~> 1.14)
|
175
|
+
railties (7.1.3.4)
|
176
|
+
actionpack (= 7.1.3.4)
|
177
|
+
activesupport (= 7.1.3.4)
|
178
|
+
irb
|
179
|
+
rackup (>= 1.0.0)
|
180
|
+
rake (>= 12.2)
|
181
|
+
thor (~> 1.0, >= 1.2.2)
|
182
|
+
zeitwerk (~> 2.6)
|
183
|
+
rainbow (3.1.1)
|
184
|
+
rake (13.2.1)
|
185
|
+
rdoc (6.7.0)
|
186
|
+
psych (>= 4.0.0)
|
187
|
+
regexp_parser (2.9.2)
|
188
|
+
reline (0.5.9)
|
189
|
+
io-console (~> 0.5)
|
190
|
+
rexml (3.3.1)
|
191
|
+
strscan
|
192
|
+
rspec-core (3.13.0)
|
193
|
+
rspec-support (~> 3.13.0)
|
194
|
+
rspec-expectations (3.13.1)
|
195
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
196
|
+
rspec-support (~> 3.13.0)
|
197
|
+
rspec-mocks (3.13.1)
|
198
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
199
|
+
rspec-support (~> 3.13.0)
|
200
|
+
rspec-rails (6.0.4)
|
201
|
+
actionpack (>= 6.1)
|
202
|
+
activesupport (>= 6.1)
|
203
|
+
railties (>= 6.1)
|
204
|
+
rspec-core (~> 3.12)
|
205
|
+
rspec-expectations (~> 3.12)
|
206
|
+
rspec-mocks (~> 3.12)
|
207
|
+
rspec-support (~> 3.12)
|
208
|
+
rspec-support (3.13.1)
|
209
|
+
rubocop (1.64.1)
|
210
|
+
json (~> 2.3)
|
211
|
+
language_server-protocol (>= 3.17.0)
|
212
|
+
parallel (~> 1.10)
|
213
|
+
parser (>= 3.3.0.2)
|
214
|
+
rainbow (>= 2.2.2, < 4.0)
|
215
|
+
regexp_parser (>= 1.8, < 3.0)
|
216
|
+
rexml (>= 3.2.5, < 4.0)
|
217
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
218
|
+
ruby-progressbar (~> 1.7)
|
219
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
220
|
+
rubocop-ast (1.31.3)
|
221
|
+
parser (>= 3.3.1.0)
|
222
|
+
rubocop-performance (1.21.1)
|
223
|
+
rubocop (>= 1.48.1, < 2.0)
|
224
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
225
|
+
ruby-progressbar (1.13.0)
|
226
|
+
semantic_range (3.0.0)
|
227
|
+
stringio (3.1.1)
|
228
|
+
strscan (3.1.0)
|
229
|
+
thor (1.3.1)
|
230
|
+
timeout (0.4.1)
|
231
|
+
tzinfo (2.0.6)
|
232
|
+
concurrent-ruby (~> 1.0)
|
233
|
+
unicode-display_width (2.5.0)
|
234
|
+
webrick (1.8.1)
|
235
|
+
websocket-driver (0.7.6)
|
236
|
+
websocket-extensions (>= 0.1.0)
|
237
|
+
websocket-extensions (0.1.5)
|
238
|
+
zeitwerk (2.6.16)
|
239
|
+
|
240
|
+
PLATFORMS
|
241
|
+
ruby
|
242
|
+
|
243
|
+
DEPENDENCIES
|
244
|
+
bundler (>= 1.3.0)
|
245
|
+
byebug
|
246
|
+
nokogiri (>= 1.13.6)
|
247
|
+
rack-proxy (>= 0.7.2)
|
248
|
+
rails (>= 6.1.6)
|
249
|
+
rails-html-sanitizer (>= 1.4.3)
|
250
|
+
rake (>= 11.1)
|
251
|
+
rspec-rails (~> 6.0.2)
|
252
|
+
rubocop
|
253
|
+
rubocop-performance
|
254
|
+
shakapacker!
|
255
|
+
|
256
|
+
BUNDLED WITH
|
257
|
+
2.5.9
|
data/README.md
CHANGED
@@ -156,7 +156,7 @@ Shakapacker uses the [`package_json`](https://github.com/shakacode/package_json)
|
|
156
156
|
|
157
157
|
If `packageManager` is not set when running `shakapacker:install`, Shakapacker will set it based on the lockfile and the result of calling `--version` on the inferred manager; if no lockfile is present, then `npm` be used unless you choose to explicitly set the `PACKAGE_JSON_FALLBACK_MANAGER` to your preferred package manager.
|
158
158
|
|
159
|
-
>
|
159
|
+
> [!NOTE]
|
160
160
|
>
|
161
161
|
> The `packageManager` property is only used to determine the package manager to use, based primarily on its name.
|
162
162
|
> The version (if present) is only used to determine if Yarn Classic or Yarn Berry should be used, but is otherwise
|
@@ -167,7 +167,9 @@ If `packageManager` is not set when running `shakapacker:install`, Shakapacker w
|
|
167
167
|
|
168
168
|
See [here](https://github.com/G-Rath/package_json#specifying-a-package-manager) for a list of the supported package managers and more information; note that `package_json` does not handle ensuring the manager is installed.
|
169
169
|
|
170
|
-
|
170
|
+
If you wish to use [Yarn PnP](https://yarnpkg.com/features/pnp) you will need to configure Babel using a `babel.config.js` file rather than via `package.json` - see [customizing Babel Config](./docs/customizing_babel_config.md) for examples on how to do this.
|
171
|
+
|
172
|
+
> [!NOTE]
|
171
173
|
>
|
172
174
|
> The rest of the documentation will only reference `npm` when providing commands such as to install optional packages except in cases where
|
173
175
|
> a particular package manager requires a very different command; otherwise it should be safe to just replace `npm` with the name of your
|
@@ -444,16 +446,13 @@ In production or CI environments, the `digest` strategy is more suitable, unless
|
|
444
446
|
|
445
447
|
You can control what strategy is used by the `compiler_strategy` option in `shakapacker.yml` config file. By default `mtime` strategy is used in development environment, `digest` is used elsewhere.
|
446
448
|
|
447
|
-
|
448
|
-
|
449
|
-
your packs will be served by the Rails public file server.
|
450
|
-
If you've enabled caching
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
assets being cached in the browser memory.
|
455
|
-
For more details see
|
456
|
-
[issue 88: Caching issues in Development since migrating to Shakapacker](https://github.com/shakacode/shakapacker/issues/88).
|
449
|
+
> [!NOTE]
|
450
|
+
>
|
451
|
+
> If you are not using the `shakapacker-dev-server`, your packs will be served by the Rails public file server.
|
452
|
+
> If you've enabled caching (Rails application `config.action_controller.perform_caching` setting),
|
453
|
+
> your changes will likely not be picked up due to `Cache-Control` header being set and assets being cached in the browser memory.
|
454
|
+
>
|
455
|
+
> For more details see [issue 88: Caching issues in Development since migrating to Shakapacker](https://github.com/shakacode/shakapacker/issues/88).
|
457
456
|
|
458
457
|
If you want to use live code reloading, or you have enough JavaScript that on-demand compilation is too slow, you'll need to run `./bin/shakapacker-dev-server`. This process will watch for changes in the relevant files, defined by `shakapacker.yml` configuration settings for `source_path`, `source_entry_path`, and `additional_paths`, and it will then automatically reload the browser to match. This feature is also known as [Hot Module Replacement](https://webpack.js.org/concepts/hot-module-replacement/).
|
459
458
|
|
@@ -14,16 +14,44 @@ The default configuration of babel is done by using `package.json` to use the fi
|
|
14
14
|
```
|
15
15
|
|
16
16
|
## Customizing the Babel Config
|
17
|
-
This example shows how you can create an object and apply _additional_ presets and plugins on top of the default.
|
18
17
|
|
19
|
-
###
|
20
|
-
|
18
|
+
### Basic Configuration
|
19
|
+
|
20
|
+
This is a very basic skeleton that you can use that includes the Shakapacker preset, and makes it easy to add new plugins and presents:
|
21
|
+
|
22
|
+
```js
|
23
|
+
// babel.config.js
|
24
|
+
module.exports = function (api) {
|
25
|
+
const defaultConfigFunc = require('shakapacker/package/babel/preset.js')
|
26
|
+
const resultConfig = defaultConfigFunc(api)
|
27
|
+
|
28
|
+
const changesOnDefault = {
|
29
|
+
presets: [
|
30
|
+
// put custom presets here
|
31
|
+
].filter(Boolean),
|
32
|
+
plugins: [
|
33
|
+
// put custom plugins here
|
34
|
+
].filter(Boolean),
|
35
|
+
}
|
21
36
|
|
37
|
+
resultConfig.presets = [...resultConfig.presets, ...changesOnDefault.presets]
|
38
|
+
resultConfig.plugins = [...resultConfig.plugins, ...changesOnDefault.plugins]
|
39
|
+
|
40
|
+
return resultConfig
|
41
|
+
}
|
22
42
|
```
|
43
|
+
|
44
|
+
### React Configuration
|
45
|
+
|
46
|
+
This shows how you can add to the above skeleton to support React - to use this, install the following dependencies:
|
47
|
+
|
48
|
+
```bash
|
23
49
|
npm install react react-dom @babel/preset-react
|
24
50
|
npm install --dev @pmmmwh/react-refresh-webpack-plugin react-refresh
|
25
51
|
```
|
26
52
|
|
53
|
+
And then update the configuration:
|
54
|
+
|
27
55
|
```js
|
28
56
|
// babel.config.js
|
29
57
|
module.exports = function (api) {
|
@@ -54,7 +82,7 @@ module.exports = function (api) {
|
|
54
82
|
}
|
55
83
|
|
56
84
|
resultConfig.presets = [...resultConfig.presets, ...changesOnDefault.presets]
|
57
|
-
resultConfig.plugins = [...resultConfig.plugins, ...changesOnDefault.plugins
|
85
|
+
resultConfig.plugins = [...resultConfig.plugins, ...changesOnDefault.plugins]
|
58
86
|
|
59
87
|
return resultConfig
|
60
88
|
}
|
data/docs/react.md
CHANGED
@@ -3,11 +3,12 @@
|
|
3
3
|
These steps describe creating a Rails/React app, using Shakapacker as the bundler.
|
4
4
|
|
5
5
|
## Easy Setup
|
6
|
+
|
6
7
|
If you'd like easy integration of React with Ruby on Rails, see [React on Rails](https://github.com/shakacode/react_on_rails).
|
7
8
|
|
8
|
-
The
|
9
|
+
The following information applies to a React on Rails app. Additionally, you need to set up some environment variables as follows:
|
9
10
|
|
10
|
-
```
|
11
|
+
```shell
|
11
12
|
EXECJS_RUNTIME=Node
|
12
13
|
```
|
13
14
|
|
data/docs/troubleshooting.md
CHANGED
@@ -180,7 +180,7 @@ default: &default
|
|
180
180
|
|
181
181
|
If you want to access any dependency without importing it everywhere or use it directly in your dev tools, please check: [https://webpack.js.org/plugins/provide-plugin/](https://webpack.js.org/plugins/provide-plugin/) and the [webpack docs on shimming globals](https://webpack.js.org/guides/shimming/#shimming-globals).
|
182
182
|
|
183
|
-
Note, if you are exposing globals, like jQuery, to non-webpack dependencies (like an inline script) via the [expose-loader](https://webpack.js.org/loaders/expose-loader/), you will need to override the default of `defer: true` to be `defer:false` your call to the `javascript_pack_tag` so that the browser will load your bundle to
|
183
|
+
Note, if you are exposing globals, like jQuery, to non-webpack dependencies (like an inline script) via the [expose-loader](https://webpack.js.org/loaders/expose-loader/), you will need to override the default of `defer: true` to be `defer:false` your call to the `javascript_pack_tag` so that the browser will load your bundle to set up the global variable before other code depends on it. However, you really should try to remove the dependency on such globals.
|
184
184
|
|
185
185
|
Thus ProvidePlugin manages build-time dependencies to global symbols whereas the expose-loader manages runtime dependencies to global symbols.
|
186
186
|
|
@@ -27,7 +27,7 @@ To use esbuild as your transpiler today. You need to do two things:
|
|
27
27
|
npm install esbuild esbuild-loader
|
28
28
|
```
|
29
29
|
|
30
|
-
2. Add or change `
|
30
|
+
2. Add or change `webpack_loader` value in your default `shakapacker.yml` config to `esbuild`
|
31
31
|
The default configuration of babel is done by using `package.json` to use the file within the `shakapacker` package.
|
32
32
|
|
33
33
|
```yml
|
data/docs/v8_upgrade.md
CHANGED
@@ -33,7 +33,7 @@ Setting for example:
|
|
33
33
|
__webpack_public_path__ = 'https://mycdn.url.com/packs';
|
34
34
|
```
|
35
35
|
|
36
|
-
In your code and ensuring it is run first in the app, will allow the dynamic imports lookup path to be
|
36
|
+
In your code and ensuring it is run first in the app, will allow the dynamic imports lookup path to be overridden at runtime.
|
37
37
|
|
38
38
|
You can also try Webpack `output.publicPath` option of `'auto'` as per https://webpack.js.org/guides/public-path/#automatic-publicpath.
|
39
39
|
|
@@ -152,7 +152,7 @@ module.exports = merge(globalMutableWebpackConfig, customConfig);
|
|
152
152
|
|
153
153
|
```js
|
154
154
|
// after
|
155
|
-
const { generateWebpackConfig } = require('shakapacker');
|
155
|
+
const { generateWebpackConfig, merge } = require('shakapacker');
|
156
156
|
|
157
157
|
const customConfig = {
|
158
158
|
module: {
|
data/jest.config.js
CHANGED
data/lib/shakapacker/version.rb
CHANGED
data/package/rules/sass.js
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
/* eslint global-require: 0 */
|
2
2
|
|
3
3
|
const getStyleRule = require("../utils/getStyleRule")
|
4
|
-
const { canProcess } = require("../utils/helpers")
|
5
|
-
const { additional_paths:
|
4
|
+
const { canProcess, packageMajorVersion } = require("../utils/helpers")
|
5
|
+
const { additional_paths: extraPaths } = require("../config")
|
6
6
|
|
7
|
-
module.exports = canProcess("sass-loader", (resolvedPath) =>
|
8
|
-
|
7
|
+
module.exports = canProcess("sass-loader", (resolvedPath) => {
|
8
|
+
const optionKey =
|
9
|
+
packageMajorVersion("sass-loader") > 15 ? "loadPaths" : "includePaths"
|
10
|
+
return getStyleRule(/\.(scss|sass)(\.erb)?$/i, [
|
9
11
|
{
|
10
12
|
loader: resolvedPath,
|
11
13
|
options: {
|
12
|
-
sassOptions: {
|
14
|
+
sassOptions: { [optionKey]: extraPaths }
|
13
15
|
}
|
14
16
|
}
|
15
17
|
])
|
16
|
-
)
|
18
|
+
})
|
data/package/utils/helpers.js
CHANGED
@@ -41,10 +41,18 @@ const loaderMatches = (configLoader, loaderToCheck, fn) => {
|
|
41
41
|
return fn()
|
42
42
|
}
|
43
43
|
|
44
|
+
const packageMajorVersion = (packageName) => {
|
45
|
+
// eslint-disable-next-line import/no-dynamic-require
|
46
|
+
const packageJsonPath = require.resolve(`${packageName}/package.json`)
|
47
|
+
// eslint-disable-next-line import/no-dynamic-require, global-require
|
48
|
+
return require(packageJsonPath).version.match(/^\d+/)[0]
|
49
|
+
}
|
50
|
+
|
44
51
|
module.exports = {
|
45
52
|
isBoolean,
|
46
53
|
ensureTrailingSlash,
|
47
54
|
canProcess,
|
48
55
|
moduleExists,
|
49
|
-
loaderMatches
|
56
|
+
loaderMatches,
|
57
|
+
packageMajorVersion
|
50
58
|
}
|