shakapacker 7.2.3 → 8.0.0.pre.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.eslintignore +1 -1
- data/.eslintrc.js +29 -8
- data/.github/PULL_REQUEST_TEMPLATE.md +10 -3
- data/.github/workflows/dummy.yml +5 -1
- data/.github/workflows/generator.yml +13 -18
- data/.github/workflows/node.yml +56 -0
- data/.github/workflows/ruby.yml +28 -17
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +52 -1
- data/README.md +88 -50
- data/Rakefile +1 -7
- data/docs/customizing_babel_config.md +2 -2
- data/docs/deployment.md +13 -6
- data/docs/react.md +6 -12
- data/docs/troubleshooting.md +4 -4
- data/docs/using_esbuild_loader.md +1 -1
- data/docs/using_swc_loader.md +1 -1
- data/docs/v8_upgrade.md +148 -0
- data/gemfiles/Gemfile-rails.7.1.x +12 -0
- data/jest.config.js +4 -0
- data/lib/install/config/shakapacker.yml +2 -2
- data/lib/install/template.rb +36 -30
- data/lib/shakapacker/base_strategy.rb +2 -1
- data/lib/shakapacker/compiler.rb +5 -20
- data/lib/shakapacker/configuration.rb +2 -46
- data/lib/shakapacker/deprecation_helper.rb +0 -78
- data/lib/shakapacker/dev_server.rb +1 -16
- data/lib/shakapacker/dev_server_runner.rb +2 -21
- data/lib/shakapacker/env.rb +1 -1
- data/lib/shakapacker/instance.rb +1 -3
- data/lib/shakapacker/manifest.rb +1 -1
- data/lib/shakapacker/railtie.rb +7 -0
- data/lib/shakapacker/runner.rb +4 -18
- data/lib/shakapacker/utils/manager.rb +58 -0
- data/lib/shakapacker/utils/misc.rb +0 -12
- data/lib/shakapacker/version.rb +1 -1
- data/lib/shakapacker/version_checker.rb +9 -30
- data/lib/shakapacker/webpack_runner.rb +2 -21
- data/lib/shakapacker.rb +0 -2
- data/lib/tasks/shakapacker/check_binstubs.rake +12 -26
- data/lib/tasks/shakapacker/check_manager.rake +3 -8
- data/lib/tasks/shakapacker/info.rake +6 -15
- data/package/babel/preset.js +15 -15
- data/package/config.js +15 -17
- data/package/dev_server.js +4 -4
- data/package/env.js +19 -17
- data/package/environments/base.js +41 -24
- data/package/environments/development.js +6 -6
- data/package/environments/production.js +16 -16
- data/package/environments/test.js +1 -1
- data/package/esbuild/index.js +6 -6
- data/package/index.d.ts +0 -1
- data/package/index.js +17 -46
- data/package/rules/babel.js +6 -8
- data/package/rules/coffee.js +2 -2
- data/package/rules/css.js +1 -1
- data/package/rules/erb.js +4 -4
- data/package/rules/esbuild.js +5 -7
- data/package/rules/file.js +17 -7
- data/package/rules/index.js +11 -11
- data/package/rules/jscommon.js +5 -5
- data/package/rules/less.js +6 -6
- data/package/rules/raw.js +1 -1
- data/package/rules/sass.js +4 -4
- data/package/rules/stylus.js +6 -6
- data/package/rules/swc.js +5 -7
- data/package/swc/index.js +10 -10
- data/package/utils/configPath.js +3 -18
- data/package/utils/defaultConfigPath.js +1 -1
- data/package/utils/{get_style_rule.js → getStyleRule.js} +6 -6
- data/package/utils/helpers.js +2 -43
- data/package/utils/inliningCss.js +4 -3
- data/package/utils/snakeToCamelCase.js +5 -0
- data/package/webpackDevServerConfig.js +28 -25
- data/package.json +11 -17
- data/prettier.config.js +4 -0
- data/shakapacker.gemspec +1 -1
- data/spec/dummy/app/javascript/packs/application.js +1 -1
- data/spec/dummy/config/application.rb +3 -0
- data/spec/dummy/config/initializers/react_on_rails.rb +2 -2
- data/spec/dummy/config/shakapacker.yml +3 -4
- data/spec/dummy/config/webpack/commonWebpackConfig.js +0 -1
- data/spec/dummy/config/webpack/webpack.config.js +1 -1
- data/spec/dummy/package.json +2 -1
- data/spec/dummy/yarn.lock +2 -3
- data/spec/generator_specs/e2e_template/template.rb +15 -28
- data/spec/generator_specs/generator_spec.rb +6 -136
- data/spec/mounted_app/test/dummy/config/webpacker.yml +0 -1
- data/spec/shakapacker/compiler_spec.rb +1 -3
- data/spec/shakapacker/configuration_spec.rb +4 -56
- data/spec/shakapacker/dev_server_runner_spec.rb +19 -102
- data/spec/shakapacker/dev_server_spec.rb +1 -16
- data/spec/shakapacker/engine_rake_tasks_spec.rb +1 -16
- data/spec/shakapacker/instance_spec.rb +1 -3
- data/spec/shakapacker/rake_tasks_spec.rb +2 -14
- data/spec/shakapacker/shakapacker_spec.rb +0 -1
- data/spec/shakapacker/test_app/config/shakapacker_css_extract_ignore_order_warnings.yml +0 -1
- data/spec/shakapacker/test_app/config/shakapacker_manifest_path.yml +0 -1
- data/spec/shakapacker/test_app/config/shakapacker_nested_entries.yml +0 -1
- data/spec/shakapacker/test_app/config/shakapacker_other_location.yml +0 -1
- data/spec/shakapacker/test_app/package.json +2 -1
- data/spec/shakapacker/utils_manager_spec.rb +125 -0
- data/spec/shakapacker/version_checker_spec.rb +4 -4
- data/spec/shakapacker/webpack_runner_spec.rb +19 -28
- data/spec/support/package_json_helpers.rb +7 -4
- data/test/helpers.js +67 -0
- data/test/package/config.test.js +50 -0
- data/test/package/dev_server.test.js +44 -0
- data/test/package/development.test.js +43 -0
- data/test/package/env.test.js +57 -0
- data/test/package/environments/base.test.js +105 -0
- data/test/package/environments/development.test.js +50 -0
- data/test/package/environments/production.test.js +106 -0
- data/test/package/index.test.js +45 -0
- data/test/package/production.test.js +32 -0
- data/test/package/rules/babel.test.js +58 -0
- data/test/package/rules/esbuild.test.js +59 -0
- data/test/package/rules/file.test.js +81 -0
- data/test/package/rules/index.test.js +7 -0
- data/test/package/rules/raw.test.js +12 -0
- data/test/package/rules/swc.test.js +59 -0
- data/test/package/staging.test.js +31 -0
- data/test/package/test.test.js +28 -0
- data/yarn.lock +1278 -421
- metadata +52 -102
- data/.github/workflows/jest.yml +0 -34
- data/.github/workflows/js-lint.yml +0 -34
- data/.github/workflows/rubocop.yml +0 -29
- data/.github/workflows/ruby-backward-compatibility.yml +0 -52
- data/lib/install/package.json +0 -15
- data/lib/tasks/shakapacker/check_yarn.rake +0 -34
- data/lib/tasks/shakapacker/yarn_install.rake +0 -24
- data/lib/tasks/webpacker/binstubs.rake +0 -9
- data/lib/tasks/webpacker/check_binstubs.rake +0 -9
- data/lib/tasks/webpacker/check_node.rake +0 -9
- data/lib/tasks/webpacker/check_yarn.rake +0 -9
- data/lib/tasks/webpacker/clean.rake +0 -9
- data/lib/tasks/webpacker/clobber.rake +0 -11
- data/lib/tasks/webpacker/compile.rake +0 -9
- data/lib/tasks/webpacker/info.rake +0 -9
- data/lib/tasks/webpacker/install.rake +0 -9
- data/lib/tasks/webpacker/verify_config.rake +0 -9
- data/lib/tasks/webpacker/verify_install.rake +0 -9
- data/lib/tasks/webpacker/yarn_install.rake +0 -9
- data/lib/tasks/webpacker.rake +0 -20
- data/lib/webpacker/dev_server_runner.rb +0 -9
- data/lib/webpacker/webpack_runner.rb +0 -9
- data/lib/webpacker.rb +0 -4
- data/package/__tests__/config-bc.js +0 -27
- data/package/__tests__/config.js +0 -46
- data/package/__tests__/dev_server-bc.js +0 -46
- data/package/__tests__/dev_server.js +0 -46
- data/package/__tests__/development-bc.js +0 -66
- data/package/__tests__/development.js +0 -66
- data/package/__tests__/env-bc.js +0 -59
- data/package/__tests__/env.js +0 -59
- data/package/__tests__/index-bc.js +0 -22
- data/package/__tests__/index.js +0 -46
- data/package/__tests__/production-bc.js +0 -51
- data/package/__tests__/production.js +0 -51
- data/package/__tests__/staging-bc.js +0 -53
- data/package/__tests__/staging.js +0 -53
- data/package/__tests__/test-bc.js +0 -43
- data/package/__tests__/test.js +0 -43
- data/package/environments/__tests__/base-bc.js +0 -107
- data/package/environments/__tests__/base.js +0 -107
- data/package/environments/__tests__/development.js +0 -53
- data/package/environments/__tests__/production.js +0 -92
- data/package/rules/__tests__/__utils__/webpack.js +0 -50
- data/package/rules/__tests__/babel.js +0 -63
- data/package/rules/__tests__/esbuild.js +0 -64
- data/package/rules/__tests__/file.js +0 -62
- data/package/rules/__tests__/index.js +0 -7
- data/package/rules/__tests__/raw.js +0 -18
- data/package/rules/__tests__/swc.js +0 -63
- data/package/utils/snakeToCamelCase +0 -7
- data/spec/backward_compatibility_specs/command_spec.rb +0 -116
- data/spec/backward_compatibility_specs/compiler_spec.rb +0 -59
- data/spec/backward_compatibility_specs/compiler_strategy_spec.rb +0 -24
- data/spec/backward_compatibility_specs/configuration_spec.rb +0 -294
- data/spec/backward_compatibility_specs/dev_server_runner_spec.rb +0 -206
- data/spec/backward_compatibility_specs/dev_server_spec.rb +0 -47
- data/spec/backward_compatibility_specs/digest_strategy_spec.rb +0 -38
- data/spec/backward_compatibility_specs/engine_rake_tasks_spec.rb +0 -67
- data/spec/backward_compatibility_specs/env_spec.rb +0 -23
- data/spec/backward_compatibility_specs/helper_spec.rb +0 -243
- data/spec/backward_compatibility_specs/instance_spec.rb +0 -31
- data/spec/backward_compatibility_specs/manifest_spec.rb +0 -100
- data/spec/backward_compatibility_specs/mtime_strategy_spec.rb +0 -55
- data/spec/backward_compatibility_specs/rake_tasks_spec.rb +0 -41
- data/spec/backward_compatibility_specs/spec_helper_initializer.rb +0 -24
- data/spec/backward_compatibility_specs/webpack_runner_spec.rb +0 -86
- data/spec/backward_compatibility_specs/webpacker_spec.rb +0 -41
- data/spec/backward_compatibility_specs/webpacker_test_app/.gitignore +0 -2
- data/spec/backward_compatibility_specs/webpacker_test_app/Rakefile +0 -3
- data/spec/backward_compatibility_specs/webpacker_test_app/app/packs/entrypoints/application.js +0 -10
- data/spec/backward_compatibility_specs/webpacker_test_app/app/packs/entrypoints/generated/something.js +0 -2
- data/spec/backward_compatibility_specs/webpacker_test_app/app/packs/entrypoints/multi_entry.css +0 -4
- data/spec/backward_compatibility_specs/webpacker_test_app/app/packs/entrypoints/multi_entry.js +0 -4
- data/spec/backward_compatibility_specs/webpacker_test_app/bin/webpacker +0 -13
- data/spec/backward_compatibility_specs/webpacker_test_app/bin/webpacker-dev-server +0 -13
- data/spec/backward_compatibility_specs/webpacker_test_app/config/application.rb +0 -11
- data/spec/backward_compatibility_specs/webpacker_test_app/config/environment.rb +0 -4
- data/spec/backward_compatibility_specs/webpacker_test_app/config/initializers/inspect_autoload_paths.rb +0 -1
- data/spec/backward_compatibility_specs/webpacker_test_app/config/webpack/webpack.config.js +0 -0
- data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker.yml +0 -83
- data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_css_extract_ignore_order_warnings.yml +0 -84
- data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_defaults_fallback.yml +0 -11
- data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_manifest_path.yml +0 -80
- data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_nested_entries.yml +0 -83
- data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_no_precompile.yml +0 -7
- data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_other_location.yml +0 -85
- data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_public_root.yml +0 -18
- data/spec/backward_compatibility_specs/webpacker_test_app/config.ru +0 -5
- data/spec/backward_compatibility_specs/webpacker_test_app/package.json +0 -13
- data/spec/backward_compatibility_specs/webpacker_test_app/public/packs/manifest.json +0 -58
- data/spec/backward_compatibility_specs/webpacker_test_app/some.config.js +0 -0
- data/spec/backward_compatibility_specs/webpacker_test_app/tmp/shakapacker/last-compilation-digest-production +0 -1
- data/spec/backward_compatibility_specs/webpacker_test_app/yarn.lock +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec98bf8d86496333c62b85cc9abbb31f44bdfb4844d64c65d7faf1bec76c8003
|
4
|
+
data.tar.gz: 3b05acd544a8cb23d74c641ee746385260eb5c0708b9af230dc1c813c7c9977c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9174d503f9e8dc6447c124dd236c3b65a66f23b780cea48e46e8921c5c4bcbcc0f5b75165175cd19f8177edce67e6c49128de58631272edcbecf5eb0431a13f
|
7
|
+
data.tar.gz: 2f8c44e24add0bc1930f2d6dbb58d20f6f5f82efbd0ffdf245b8ce85da4c4fa7c7d9dab07fc6d60f6709265b4e2ed23e0194040d8cba6c60cd62ef92e4e16d8e
|
data/.eslintignore
CHANGED
data/.eslintrc.js
CHANGED
@@ -1,15 +1,36 @@
|
|
1
1
|
module.exports = {
|
2
|
-
extends: [
|
2
|
+
extends: ["airbnb", "plugin:prettier/recommended"],
|
3
3
|
rules: {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
"indent": ["error", 2],
|
9
|
-
semi: ['error', 'never']
|
4
|
+
"import/no-unresolved": "off",
|
5
|
+
"import/no-extraneous-dependencies": "off",
|
6
|
+
"import/extensions": "off",
|
7
|
+
indent: ["error", 2]
|
10
8
|
},
|
11
9
|
env: {
|
12
10
|
browser: true,
|
13
11
|
node: true
|
14
|
-
}
|
12
|
+
},
|
13
|
+
overrides: [
|
14
|
+
{
|
15
|
+
files: ["test/**"],
|
16
|
+
extends: ["plugin:jest/recommended", "plugin:jest/style"],
|
17
|
+
rules: {
|
18
|
+
"global-require": "off",
|
19
|
+
"jest/prefer-called-with": "error",
|
20
|
+
"jest/no-conditional-in-test": "error",
|
21
|
+
"jest/no-test-return-statement": "error",
|
22
|
+
"jest/prefer-expect-resolves": "error",
|
23
|
+
"jest/require-to-throw-message": "error",
|
24
|
+
"jest/require-top-level-describe": "error",
|
25
|
+
"jest/prefer-hooks-on-top": "error",
|
26
|
+
"jest/prefer-lowercase-title": [
|
27
|
+
"error",
|
28
|
+
{ ignoreTopLevelDescribe: true }
|
29
|
+
],
|
30
|
+
"jest/prefer-spy-on": "error",
|
31
|
+
"jest/prefer-strict-equal": "error",
|
32
|
+
"jest/prefer-todo": "error"
|
33
|
+
}
|
34
|
+
}
|
35
|
+
]
|
15
36
|
}
|
@@ -1,9 +1,13 @@
|
|
1
1
|
### Summary
|
2
2
|
|
3
|
-
|
3
|
+
<!--
|
4
|
+
Describe the code changes in your pull request here - were there any bugs you had fixed, features you added, tradeoffs you made?
|
5
|
+
If so, mention them. If these changes have open GitHub issues, tag them here as well to keep the conversation linked.
|
6
|
+
-->
|
4
7
|
|
5
8
|
### Pull Request checklist
|
6
|
-
|
9
|
+
|
10
|
+
<!-- If any of the items on this checklist do not apply to the PR, both check it out and wrap it by `~`. -->
|
7
11
|
|
8
12
|
- [ ] Add/update test to cover these changes
|
9
13
|
- [ ] Update documentation
|
@@ -11,4 +15,7 @@ _Remove this line after checking all the items here. If the item does not apply
|
|
11
15
|
|
12
16
|
### Other Information
|
13
17
|
|
14
|
-
|
18
|
+
<!--
|
19
|
+
Mention any other important information that might relate to this PR but that don't belong in the summary,
|
20
|
+
like detailed benchmarks or possible follow-up changes.
|
21
|
+
-->
|
data/.github/workflows/dummy.yml
CHANGED
@@ -4,9 +4,13 @@ on:
|
|
4
4
|
push:
|
5
5
|
branches:
|
6
6
|
- 'main'
|
7
|
-
- 'next'
|
8
7
|
pull_request:
|
9
8
|
|
9
|
+
concurrency:
|
10
|
+
# Pushing new changes to a branch will cancel any in-progress CI runs
|
11
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
12
|
+
cancel-in-progress: true
|
13
|
+
|
10
14
|
jobs:
|
11
15
|
test:
|
12
16
|
runs-on: ubuntu-latest
|
@@ -4,9 +4,13 @@ on:
|
|
4
4
|
push:
|
5
5
|
branches:
|
6
6
|
- 'main'
|
7
|
-
- 'next'
|
8
7
|
pull_request:
|
9
8
|
|
9
|
+
concurrency:
|
10
|
+
# Pushing new changes to a branch will cancel any in-progress CI runs
|
11
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
12
|
+
cancel-in-progress: true
|
13
|
+
|
10
14
|
jobs:
|
11
15
|
test:
|
12
16
|
name: Generator specs
|
@@ -14,22 +18,21 @@ jobs:
|
|
14
18
|
strategy:
|
15
19
|
matrix:
|
16
20
|
os: [ubuntu-latest]
|
17
|
-
ruby: ['2.
|
18
|
-
use_package_json_gem: ['true', 'false']
|
21
|
+
ruby: ['2.7', '3.0', '3.1', '3.2']
|
19
22
|
gemfile:
|
20
23
|
- gemfiles/Gemfile-rails.6.0.x
|
21
24
|
- gemfiles/Gemfile-rails.6.1.x
|
22
25
|
- gemfiles/Gemfile-rails.7.0.x
|
26
|
+
- gemfiles/Gemfile-rails.7.1.x
|
23
27
|
# Uncomment the following line only to ensure compatibility with the
|
24
28
|
# upcomming Rails versions, maybe before a release.
|
25
29
|
#- gemfiles/Gemfile-rails-edge
|
26
30
|
exclude:
|
27
|
-
- ruby:
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
gemfile: gemfiles/Gemfile-rails-edge
|
31
|
+
- ruby: '3.1'
|
32
|
+
gemfile: gemfiles/Gemfile-rails.6.0.x
|
33
|
+
- ruby: '3.2'
|
34
|
+
gemfile: gemfiles/Gemfile-rails.6.0.x
|
35
|
+
|
33
36
|
env:
|
34
37
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
35
38
|
|
@@ -40,13 +43,5 @@ jobs:
|
|
40
43
|
- uses: ruby/setup-ruby@v1
|
41
44
|
with:
|
42
45
|
ruby-version: ${{ matrix.ruby }}
|
43
|
-
|
44
|
-
- name: Use Bundler 2.4.22
|
45
|
-
run: |
|
46
|
-
gem install bundler -v '2.4.22'
|
47
|
-
bundle config --local path vendor/bundle
|
48
|
-
- name: Install dependencies
|
49
|
-
run: bundle install
|
46
|
+
bundler-cache: true
|
50
47
|
- run: bundle exec rake run_spec:generator
|
51
|
-
env:
|
52
|
-
SHAKAPACKER_USE_PACKAGE_JSON_GEM: ${{ matrix.use_package_json_gem }}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
name: Node based checks
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- 'main'
|
7
|
+
pull_request:
|
8
|
+
|
9
|
+
concurrency:
|
10
|
+
# Pushing new changes to a branch will cancel any in-progress CI runs
|
11
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
12
|
+
cancel-in-progress: true
|
13
|
+
|
14
|
+
jobs:
|
15
|
+
lint:
|
16
|
+
name: Linting
|
17
|
+
runs-on: ubuntu-latest
|
18
|
+
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v4
|
21
|
+
with:
|
22
|
+
persist-credentials: false
|
23
|
+
- uses: actions/setup-node@v4
|
24
|
+
with:
|
25
|
+
node-version: 20.x
|
26
|
+
cache: yarn
|
27
|
+
|
28
|
+
- name: Install dependencies
|
29
|
+
run: yarn --frozen-lockfile --non-interactive --prefer-offline
|
30
|
+
|
31
|
+
- name: Node eslint
|
32
|
+
run: yarn lint
|
33
|
+
test:
|
34
|
+
name: Testing
|
35
|
+
strategy:
|
36
|
+
matrix:
|
37
|
+
os: [ubuntu-latest]
|
38
|
+
node: [14.x, 16.x, 18.x, 20.x]
|
39
|
+
|
40
|
+
runs-on: ${{ matrix.os }}
|
41
|
+
|
42
|
+
steps:
|
43
|
+
- uses: actions/checkout@v4
|
44
|
+
with:
|
45
|
+
persist-credentials: false
|
46
|
+
- name: Use Node.js ${{ matrix.node }}
|
47
|
+
uses: actions/setup-node@v3
|
48
|
+
with:
|
49
|
+
node-version: ${{ matrix.node }}
|
50
|
+
cache: yarn
|
51
|
+
|
52
|
+
- name: Install dependencies
|
53
|
+
run: yarn --frozen-lockfile --non-interactive --prefer-offline
|
54
|
+
|
55
|
+
- name: Jest Specs
|
56
|
+
run: yarn test
|
data/.github/workflows/ruby.yml
CHANGED
@@ -1,34 +1,52 @@
|
|
1
|
-
name: Ruby
|
1
|
+
name: Ruby based checks
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
5
|
branches:
|
6
6
|
- 'main'
|
7
|
-
- 'next'
|
8
7
|
pull_request:
|
9
8
|
|
9
|
+
concurrency:
|
10
|
+
# Pushing new changes to a branch will cancel any in-progress CI runs
|
11
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
12
|
+
cancel-in-progress: true
|
13
|
+
|
10
14
|
jobs:
|
15
|
+
lint:
|
16
|
+
name: Linting
|
17
|
+
runs-on: ubuntu-latest
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v4
|
20
|
+
with:
|
21
|
+
persist-credentials: false
|
22
|
+
- uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: '3.2'
|
25
|
+
bundler-cache: true
|
26
|
+
|
27
|
+
- name: Ruby rubocop
|
28
|
+
run: bundle exec rubocop
|
29
|
+
|
11
30
|
test:
|
12
|
-
name:
|
31
|
+
name: Testing
|
13
32
|
runs-on: ${{ matrix.os }}
|
14
33
|
strategy:
|
15
34
|
matrix:
|
16
35
|
os: [ubuntu-latest]
|
17
|
-
ruby: ['2.
|
36
|
+
ruby: ['2.7', '3.0', '3.1', '3.2']
|
18
37
|
gemfile:
|
19
38
|
- gemfiles/Gemfile-rails.6.0.x
|
20
39
|
- gemfiles/Gemfile-rails.6.1.x
|
21
40
|
- gemfiles/Gemfile-rails.7.0.x
|
41
|
+
- gemfiles/Gemfile-rails.7.1.x
|
22
42
|
# Uncomment the following line only to ensure compatibility with the
|
23
43
|
# upcomming Rails versions, maybe before a release.
|
24
44
|
#- gemfiles/Gemfile-rails-edge
|
25
45
|
exclude:
|
26
|
-
- ruby:
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
os: ubuntu-latest
|
31
|
-
gemfile: gemfiles/Gemfile-rails-edge
|
46
|
+
- ruby: '3.1'
|
47
|
+
gemfile: gemfiles/Gemfile-rails.6.0.x
|
48
|
+
- ruby: '3.2'
|
49
|
+
gemfile: gemfiles/Gemfile-rails.6.0.x
|
32
50
|
|
33
51
|
env:
|
34
52
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
@@ -44,10 +62,3 @@ jobs:
|
|
44
62
|
|
45
63
|
- name: Ruby specs
|
46
64
|
run: bundle exec rake run_spec:gem
|
47
|
-
env:
|
48
|
-
SHAKAPACKER_USE_PACKAGE_JSON_GEM: "false"
|
49
|
-
|
50
|
-
- name: Ruby specs
|
51
|
-
run: bundle exec rake run_spec:gem
|
52
|
-
env:
|
53
|
-
SHAKAPACKER_USE_PACKAGE_JSON_GEM: "true"
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,15 +1,65 @@
|
|
1
1
|
* For the changelog of versions prior to v6, see the [5.x stable branch of rails/webpacker](https://github.com/rails/webpacker/tree/5-x-stable).
|
2
|
+
* Please see the [v8 Upgrade Guide](./docs/v8_upgrade.md) for upgrading to version 8 and accounting for breaking changes.
|
2
3
|
* Please see the [v7 Upgrade Guide](./docs/v7_upgrade.md) for upgrading to new spelling in version 7.
|
3
4
|
* Please see the [v6 Upgrade Guide](./docs/v6_upgrade.md) to go from versions prior to v6.
|
4
5
|
* [ShakaCode](https://www.shakacode.com) offers support for upgrading from Webpacker or using Shakapacker. If interested, contact Justin Gordon, [justin@shakacode.com](mailto:justin@shakacode.com).
|
5
6
|
|
7
|
+
_next_ branch is for v8 changes
|
8
|
+
|
6
9
|
## Versions
|
7
10
|
## [Unreleased]
|
8
11
|
Changes since the last non-beta release.
|
9
12
|
|
13
|
+
### Breaking changes
|
14
|
+
- Remove `relative_url_root` [PR 413](https://github.com/shakacode/shakapacker/pull/413) by [G-Rath](https://github.com/g-rath).
|
15
|
+
|
16
|
+
- 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).
|
17
|
+
|
18
|
+
The usage of those has been deprecated in Shakapacker v7 and now fully removed in v8. See the [v7 Upgrade Guide](./docs/v7_upgrade.md) for more information if you are still yet to address this deprecation.
|
19
|
+
|
20
|
+
- Remove `globalMutableWebpackConfig` global [PR 439](https://github.com/shakacode/shakapacker/pull/439) by [G-Rath](https://github.com/g-rath).
|
21
|
+
|
22
|
+
Use `generateWebpackConfig` instead.
|
23
|
+
|
24
|
+
- Use `package_json` gem to manage Node dependencies and commands, and use `npm` by default [PR 430](https://github.com/shakacode/shakapacker/pull/430) by [G-Rath](https://github.com/g-rath)
|
25
|
+
|
26
|
+
This enables support for package managers other than `yarn`, with `npm` being the default; to continue using Yarn,
|
27
|
+
specify it in `package.json` using the [`packageManager`](https://nodejs.org/api/packages.html#packagemanager) property.
|
28
|
+
|
29
|
+
- 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).
|
30
|
+
|
31
|
+
- Remove `check_yarn` rake task [PR 443](https://github.com/shakacode/shakapacker/pull/443) by [G-Rath](https://github.com/g-rath).
|
32
|
+
|
33
|
+
- Remove `https` option for `webpack-dev-server` [PR 414](https://github.com/shakacode/shakapacker/pull/414) by [G-Rath](https://github.com/g-rath).
|
34
|
+
|
35
|
+
- Remove `verify_file_existance` method [PR 446](https://github.com/shakacode/shakapacker/pull/446) by [G-Rath](https://github.com/g-rath).
|
36
|
+
|
37
|
+
- Drop support for Ruby 2.6 [PR 415](https://github.com/shakacode/shakapacker/pull/415) by [G-Rath](https://github.com/g-rath).
|
38
|
+
|
39
|
+
- Drop support for Node v12 [PR 431](https://github.com/shakacode/shakapacker/pull/431) by [G-Rath](https://github.com/g-rath).
|
40
|
+
|
41
|
+
- Enable `ensure_consistent_versioning` by default [PR 447](https://github.com/shakacode/shakapacker/pull/447) by [G-Rath](https://github.com/g-rath).
|
42
|
+
|
43
|
+
- Asset files put in `additional_paths` will have their path stripped just like with the `source_path`. [PR 403](https://github.com/shakacode/shakapacker/pull/403) by [paypro-leon](https://github.com/paypro-leon).
|
44
|
+
|
45
|
+
- Remove `isArray` utility (just use `Array.isArray` directly) and renamed a few files [PR 454](https://github.com/shakacode/shakapacker/pull/454) by [G-Rath](https://github.com/g-rath).
|
46
|
+
|
47
|
+
- Make JavaScript test helper utilities internal (`chdirTestApp`, `chdirCwd`, `resetEnv`) [PR 458](https://github.com/shakacode/shakapacker/pull/458) by [G-Rath](https://github.com/g-rath).
|
48
|
+
|
49
|
+
## [v7.2.3] - March 23, 2024
|
50
|
+
|
51
|
+
### Added
|
10
52
|
- Emit warnings instead of errors when compilation is success but stderr is not empty. [PR 416](https://github.com/shakacode/shakapacker/pull/416) by [n-rodriguez](https://github.com/n-rodriguez).
|
11
53
|
- Allow `webpack-dev-server` v5. [PR 418](https://github.com/shakacode/shakapacker/pull/418) by [G-Rath](https://github.com/g-rath)
|
12
54
|
|
55
|
+
### Removed
|
56
|
+
- Removes dependency on `glob` library. [PR 435](https://github.com/shakacode/shakapacker/pull/435) by [tomdracz](https://github.com/tomdracz).
|
57
|
+
|
58
|
+
### Fixed
|
59
|
+
- Uses config file passed in `SHAKAPACKER_CONFIG` consistently.[PR 448](https://github.com/shakacode/shakapacker/pull/448) by [tomdracz](https://github.com/tomdracz).
|
60
|
+
|
61
|
+
Previously this could have been ignored in few code branches, especially when checking for available environments.
|
62
|
+
|
13
63
|
## [v7.2.2] - January 19, 2024
|
14
64
|
|
15
65
|
### Added
|
@@ -303,7 +353,8 @@ Note: [Rubygem is 6.3.0.pre.rc.1](https://rubygems.org/gems/shakapacker/versions
|
|
303
353
|
## v5.4.3 and prior changes from rails/webpacker
|
304
354
|
See [CHANGELOG.md in rails/webpacker (up to v5.4.3)](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
|
305
355
|
|
306
|
-
[Unreleased]: https://github.com/shakacode/shakapacker/compare/v7.2.
|
356
|
+
[Unreleased]: https://github.com/shakacode/shakapacker/compare/v7.2.3...main
|
357
|
+
[v7.2.3]: https://github.com/shakacode/shakapacker/compare/v7.2.2...v7.2.3
|
307
358
|
[v7.2.2]: https://github.com/shakacode/shakapacker/compare/v7.2.1...v7.2.2
|
308
359
|
[v7.2.1]: https://github.com/shakacode/shakapacker/compare/v7.2.0...v7.2.1
|
309
360
|
[v7.2.0]: https://github.com/shakacode/shakapacker/compare/v7.1.0...v7.2.0
|
data/README.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
# Shakapacker (
|
1
|
+
# Shakapacker (v8)
|
2
2
|
|
3
3
|
_Official, actively maintained successor to [rails/webpacker](https://github.com/rails/webpacker).ShakaCode stands behind the long-term maintenance and development of this project for the Rails community._
|
4
4
|
|
5
5
|
* ⚠️ See the [6-stable](https://github.com/shakacode/shakapacker/tree/6-stable) branch for Shakapacker v6.x code and documentation. :warning:
|
6
|
+
* See [V8 Upgrade](./docs/v8_upgrade.md) for upgrading from the v7 release.
|
6
7
|
* See [V7 Upgrade](./docs/v7_upgrade.md) for upgrading from the v6 release.
|
7
8
|
* See [V6 Upgrade](./docs/v6_upgrade.md) for upgrading from v5 or prior v6 releases.
|
8
9
|
|
@@ -51,8 +52,6 @@ Read the [full review here](https://clutch.co/profile/shakacode#reviews?sort_by=
|
|
51
52
|
- [Optional support](#optional-support)
|
52
53
|
- [Installation](#installation)
|
53
54
|
- [Rails v6+](#rails-v6)
|
54
|
-
- [Using alternative package managers](#using-alternative-package-managers)
|
55
|
-
- [Note for Yarn v2 usage](#note-for-yarn-v2-usage)
|
56
55
|
- [Concepts](#concepts)
|
57
56
|
- [Usage](#usage)
|
58
57
|
- [Configuration and Code](#configuration-and-code)
|
@@ -98,16 +97,16 @@ Read the [full review here](https://clutch.co/profile/shakacode#reviews?sort_by=
|
|
98
97
|
|
99
98
|
## Prerequisites
|
100
99
|
|
101
|
-
- Ruby 2.
|
100
|
+
- Ruby 2.7+
|
102
101
|
- Rails 5.2+
|
103
|
-
- Node.js
|
104
|
-
- Yarn
|
102
|
+
- Node.js 14+
|
105
103
|
|
106
104
|
## Features
|
107
105
|
- Rails view helpers that fully support Webpack output, including HMR and code splitting.
|
108
106
|
- Convenient but not required webpack configuration. The only requirement is that your webpack configuration creates a manifest.
|
109
107
|
- HMR with the `shakapacker-dev-server`, such as for hot-reloading React!
|
110
108
|
- Automatic code splitting using multiple entry points to optimize JavaScript downloads.
|
109
|
+
- Support for [NPM](https://www.npmjs.com/package/npm), Yarn ([classic](https://classic.yarnpkg.com/lang/en/) and [berry](https://yarnpkg.com/getting-started)), [PNPM](https://pnpm.io/), and [Bun](https://bun.sh/)
|
111
110
|
- [Webpack v5+](https://webpack.js.org/)
|
112
111
|
- ES6 with [babel](https://babeljs.io/), [SWC](https://swc.rs/), or [Esbuild](https://github.com/privatenumber/esbuild-loader)
|
113
112
|
- Asset compression, source-maps, and minification
|
@@ -147,40 +146,45 @@ Then run the following to install Shakapacker:
|
|
147
146
|
|
148
147
|
Before initiating the installation process, ensure you have committed all the changes. While installing Shakapacker, there might be some conflict between the existing file content and what Shakapacker tries to copy. You can either approve all the prompts for overriding these files or use the `FORCE=true` environment variable before the installation command to force the override without any prompt.
|
149
148
|
|
150
|
-
|
149
|
+
Shakapacker uses the [`package_json`](https://github.com/shakacode/package_json) gem to handle updating the `package.json` and interacting with the underlying package manager of choice for managing dependencies and running commands; the package manager is managed using the [`packageManager`](https://nodejs.org/api/packages.html#packagemanager) property in the `package.json`, otherwise falling back to the value of `PACKAGE_JSON_FALLBACK_MANAGER` if set or otherwise `npm`.
|
151
150
|
|
152
|
-
|
153
|
-
yarn
|
154
|
-
```
|
155
|
-
|
156
|
-
Note, in v6+, most JS packages are peer dependencies. Thus, the installer will add the packages:
|
157
|
-
|
158
|
-
```bash
|
159
|
-
yarn add @babel/core @babel/plugin-transform-runtime @babel/preset-env @babel/runtime babel-loader \
|
160
|
-
compression-webpack-plugin terser-webpack-plugin \
|
161
|
-
webpack webpack-assets-manifest webpack-cli webpack-merge webpack-sources webpack-dev-server
|
162
|
-
```
|
163
|
-
|
164
|
-
Previously, these "webpack" and "babel" packages were direct dependencies for `shakapacker`. By
|
165
|
-
making these peer dependencies, you have control over the versions used in your webpack and babel configs.
|
166
|
-
|
167
|
-
### Using alternative package managers
|
168
|
-
|
169
|
-
There is experimental support for using package managers besides Yarn classic for managing JavaScript dependencies using the [`package_json`](https://github.com/G-Rath/package_json) gem.
|
151
|
+
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.
|
170
152
|
|
171
|
-
|
153
|
+
> **Note**
|
154
|
+
>
|
155
|
+
> The `packageManager` property is only used to determine the package manager to use, based primarily on its name.
|
156
|
+
> The version (if present) is only used to determine if Yarn Classic or Yarn Berry should be used, but is otherwise
|
157
|
+
> _not_ checked, nor is [`corepack`](https://nodejs.org/api/corepack.html) used to ensure that the package manager is installed.
|
158
|
+
>
|
159
|
+
> It is up to the developer to ensure that the desired package manager is actually install at the right version, which can be done
|
160
|
+
> using `corepack` or by other means.
|
172
161
|
|
173
162
|
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.
|
174
163
|
|
175
|
-
>
|
176
|
-
>
|
177
|
-
> The rest of the documentation
|
164
|
+
> [NOTE]
|
165
|
+
>
|
166
|
+
> The rest of the documentation will only reference `npm` when providing commands such as to install optional packages except in cases where
|
167
|
+
> a particular package manager requires a very different command; otherwise it should be safe to just replace `npm` with the name of your
|
168
|
+
> preferred package manager when running the command
|
178
169
|
|
179
|
-
|
170
|
+
Note, in v6+, most JS packages are peer dependencies. Thus, the installer will add the packages:
|
180
171
|
|
181
|
-
|
172
|
+
- `@babel/core`
|
173
|
+
- `@babel/plugin-transform-runtime`
|
174
|
+
- `@babel/preset-env`
|
175
|
+
- `@babel/runtime`
|
176
|
+
- `babel-loader`
|
177
|
+
- `compression-webpack-plugin`
|
178
|
+
- `terser-webpack-plugin`
|
179
|
+
- `webpack`
|
180
|
+
- `webpack-assets-manifest`
|
181
|
+
- `webpack-cli`
|
182
|
+
- `webpack-merge`
|
183
|
+
- `webpack-sources`
|
184
|
+
- `webpack-dev-server`
|
182
185
|
|
183
|
-
|
186
|
+
Previously, these "webpack" and "babel" packages were direct dependencies for `shakapacker`. By
|
187
|
+
making these peer dependencies, you have control over the versions used in your webpack and babel configs.
|
184
188
|
|
185
189
|
## Concepts
|
186
190
|
|
@@ -578,8 +582,11 @@ console.log(JSON.stringify(webpackConfig, undefined, 2))
|
|
578
582
|
You may want to modify the rules in the default configuration. For instance, if you are using a custom svg loader, you may want to remove `.svg` from the default file loader rules. You can search and filter the default rules like so:
|
579
583
|
|
580
584
|
```js
|
581
|
-
const
|
582
|
-
|
585
|
+
const fileRule = config.module.rules.find(rule => rule.test.test('.svg'));
|
586
|
+
// removing svg from asset file rule's test RegExp
|
587
|
+
fileRule.test = /\.(bmp|gif|jpe?g|png|tiff|ico|avif|webp|eot|otf|ttf|woff|woff2)$/
|
588
|
+
// changing the rule type from 'asset/resource' to 'asset'. See https://webpack.js.org/guides/asset-modules/
|
589
|
+
fileRule.type = 'asset'
|
583
590
|
```
|
584
591
|
|
585
592
|
### Babel configuration
|
@@ -621,13 +628,13 @@ See also [Customizing Babel Config](./docs/customizing_babel_config.md) for an e
|
|
621
628
|
#### TypeScript
|
622
629
|
|
623
630
|
```bash
|
624
|
-
|
631
|
+
npm install typescript @babel/preset-typescript
|
625
632
|
```
|
626
633
|
|
627
634
|
Babel won’t perform any type-checking on TypeScript code. To optionally use type-checking run:
|
628
635
|
|
629
636
|
```bash
|
630
|
-
|
637
|
+
npm install fork-ts-checker-webpack-plugin
|
631
638
|
```
|
632
639
|
|
633
640
|
Add tsconfig.json
|
@@ -668,7 +675,7 @@ module.exports = generateWebpackConfig({
|
|
668
675
|
To enable CSS support in your application, add the following packages:
|
669
676
|
|
670
677
|
```bash
|
671
|
-
|
678
|
+
npm install css-loader style-loader mini-css-extract-plugin css-minimizer-webpack-plugin
|
672
679
|
```
|
673
680
|
|
674
681
|
Optionally, add the `CSS` extension to webpack config for easy resolution.
|
@@ -692,18 +699,18 @@ then add the relevant pre-processors:
|
|
692
699
|
#### Postcss
|
693
700
|
|
694
701
|
```bash
|
695
|
-
|
702
|
+
npm install postcss postcss-loader
|
696
703
|
```
|
697
704
|
|
698
705
|
Optionally add these two plugins if they are required in your `postcss.config.js`:
|
699
706
|
```bash
|
700
|
-
|
707
|
+
npm install postcss-preset-env postcss-flexbugs-fixes
|
701
708
|
```
|
702
709
|
|
703
710
|
#### Sass
|
704
711
|
|
705
712
|
```bash
|
706
|
-
|
713
|
+
npm install sass-loader
|
707
714
|
```
|
708
715
|
|
709
716
|
You will also need to install [Dart Sass](https://github.com/sass/dart-sass), [Node Sass](https://github.com/sass/node-sass) or [Sass Embedded](https://github.com/sass/embedded-host-node) to pick the implementation to use. sass-loader will automatically pick an implementation based on installed packages.
|
@@ -712,35 +719,35 @@ Please refer to [sass-loader documentation](https://www.npmjs.com/package/sass-l
|
|
712
719
|
|
713
720
|
##### Dart Sass
|
714
721
|
```bash
|
715
|
-
|
722
|
+
npm install sass
|
716
723
|
```
|
717
724
|
|
718
725
|
##### Node Sass
|
719
726
|
```bash
|
720
|
-
|
727
|
+
npm install node-sass
|
721
728
|
```
|
722
729
|
|
723
730
|
##### Sass Embedded
|
724
731
|
```bash
|
725
|
-
|
732
|
+
npm install sass-embedded
|
726
733
|
```
|
727
734
|
|
728
735
|
#### Less
|
729
736
|
|
730
737
|
```bash
|
731
|
-
|
738
|
+
npm install less less-loader
|
732
739
|
```
|
733
740
|
|
734
741
|
#### Stylus
|
735
742
|
|
736
743
|
```bash
|
737
|
-
|
744
|
+
npm install stylus stylus-loader
|
738
745
|
```
|
739
746
|
|
740
747
|
#### CoffeeScript
|
741
748
|
|
742
749
|
```bash
|
743
|
-
|
750
|
+
npm install coffeescript coffee-loader
|
744
751
|
```
|
745
752
|
|
746
753
|
#### Other frameworks
|
@@ -840,16 +847,24 @@ bundle update shakapacker
|
|
840
847
|
# overwrite your changes to the default install files and revert any unwanted changes from the install
|
841
848
|
rails shakapacker:install
|
842
849
|
|
843
|
-
#
|
850
|
+
# using npm
|
851
|
+
npm install shakapacker@latest
|
852
|
+
npm install webpack-dev-server@latest
|
853
|
+
|
854
|
+
# using yarn classic
|
844
855
|
yarn upgrade shakapacker --latest
|
845
856
|
yarn upgrade webpack-dev-server --latest
|
846
857
|
|
847
|
-
# yarn
|
858
|
+
# using yarn berry
|
848
859
|
yarn up shakapacker@latest
|
849
860
|
yarn up webpack-dev-server@latest
|
850
861
|
|
862
|
+
# using pnpm
|
863
|
+
pnpm up shakapacker@latest
|
864
|
+
pnpm up webpack-dev-server@latest
|
865
|
+
|
851
866
|
# Or to install the latest release (including pre-releases)
|
852
|
-
|
867
|
+
npm install shakapacker@next
|
853
868
|
```
|
854
869
|
|
855
870
|
Also, consult the [CHANGELOG](./CHANGELOG.md) for additional upgrade links.
|
@@ -899,6 +914,12 @@ import 'stylesheets/main'
|
|
899
914
|
import 'images/rails.png'
|
900
915
|
```
|
901
916
|
|
917
|
+
Assets put in these folders will also have their path stripped just like with the `source_path`.
|
918
|
+
|
919
|
+
Example:
|
920
|
+
|
921
|
+
A file in `app/assets/images/image.svg` with `additional_paths: ['app/assets']` will result in `static/images/image.svg`
|
922
|
+
|
902
923
|
**Note:** Please be careful when adding paths here otherwise it will make the compilation slow, consider adding specific paths instead of the whole parent directory if you just need to reference one or two modules
|
903
924
|
|
904
925
|
**Also note:** While importing assets living outside your `source_path` defined in shakapacker.yml (like, for instance, assets under `app/assets`) from within your packs using _relative_ paths like `import '../../assets/javascripts/file.js'` will work in development, Shakapacker won't recompile the bundle in production unless a file that lives in one of it's watched paths has changed (check out `Shakapacker::MtimeStrategy#latest_modified_timestamp` or `Shakapacker::DigestStrategy#watched_files_digest` depending on strategy configured by `compiler_strategy` option in `shakapacker.yml`). That's why you'd need to add `app/assets` to the additional_paths as stated above and use `import 'javascripts/file.js'` instead.
|
@@ -910,7 +931,24 @@ Shakapacker hooks up a new `shakapacker:compile` task to `assets:precompile`, wh
|
|
910
931
|
|
911
932
|
This behavior is optional & can be disabled by either setting a `SHAKAPACKER_PRECOMPILE` environment variable to `false`, `no`, `n`, or `f`, or by setting a `shakapacker_precompile` key in your `shakapacker.yml` to `false`. ([source code](./lib/shakapacker/configuration.rb#L34))
|
912
933
|
|
913
|
-
When compiling assets for production on a remote server, such as a continuous integration environment, it's recommended to
|
934
|
+
When compiling assets for production on a remote server, such as a continuous integration environment, it's recommended to ensure the exact versions specified in your lockfile are installed:
|
935
|
+
|
936
|
+
```
|
937
|
+
# using npm
|
938
|
+
npm ci
|
939
|
+
|
940
|
+
# using yarn classic
|
941
|
+
yarn install --frozen-lockfile
|
942
|
+
|
943
|
+
# using yarn berry
|
944
|
+
yarn install --immutable
|
945
|
+
|
946
|
+
# using pnpm
|
947
|
+
pnpm install --frozen-lockfile
|
948
|
+
|
949
|
+
# using bun
|
950
|
+
bun install --frozen-lockfile
|
951
|
+
```
|
914
952
|
|
915
953
|
If you are using a CDN setup, Shakapacker does NOT use the `ASSET_HOST` environment variable to prefix URLs for assets during bundle compilation. You must use the `SHAKAPACKER_ASSET_HOST` environment variable instead (`WEBPACKER_ASSET_HOST` if you're using any version of Webpacker or Shakapacker before Shakapacker v7).
|
916
954
|
|