|
1 | | ---- |
2 | | -default: |
| 1 | +# Note: You must restart bin/shakapacker-dev-server for changes to take effect |
| 2 | + |
| 3 | +default: &default |
3 | 4 | source_path: client/app |
4 | 5 | source_entry_path: packs |
5 | 6 | public_root_path: public |
6 | 7 | cache_path: tmp/cache/shakapacker |
7 | 8 | webpack_compile_output: false |
8 | 9 | ensure_consistent_versioning: true |
9 | | - additional_paths: &1 [] |
| 10 | + |
| 11 | + # Additional paths webpack should lookup modules |
| 12 | + # ['app/assets', 'engine/foo/app/assets'] |
| 13 | + additional_paths: [] |
| 14 | + |
| 15 | + # Reload manifest.json on all requests so we reload latest compiled packs |
10 | 16 | cache_manifest: false |
11 | 17 | nested_entries: true |
| 18 | + |
| 19 | + # Use SWC instead of Babel for transpilation (~20x faster) |
12 | 20 | swc: true |
| 21 | + |
13 | 22 | development: |
14 | | - source_path: client/app |
15 | | - source_entry_path: packs |
16 | | - public_root_path: public |
17 | | - cache_path: tmp/cache/shakapacker |
18 | | - webpack_compile_output: false |
19 | | - ensure_consistent_versioning: true |
20 | | - additional_paths: *1 |
21 | | - cache_manifest: false |
22 | | - nested_entries: true |
| 23 | + <<: *default |
| 24 | + # Turn this to true if you want to use the rails/shakapacker check that the test |
| 25 | + # bundles need building. Also, remove the customization to spec/rails_helper.rb. |
23 | 26 | compile: false |
| 27 | + |
24 | 28 | public_output_path: webpack/development |
| 29 | + |
| 30 | + # Reference: https://webpack.js.org/configuration/dev-server/ |
25 | 31 | dev_server: |
26 | 32 | https: false |
27 | 33 | host: localhost |
28 | 34 | port: 3035 |
| 35 | + # Hot Module Replacement updates modules while the application is running without a full reload |
29 | 36 | hmr: true |
| 37 | + # Defaults to the inverse of hmr. Uncomment to manually set this. |
| 38 | + # live_reload: true |
30 | 39 | client: |
| 40 | + # Should we show a full-screen overlay in the browser when there are compiler errors or warnings? |
31 | 41 | overlay: true |
| 42 | + # May also be a string |
| 43 | + # webSocketURL: |
| 44 | + # hostname: "0.0.0.0" |
| 45 | + # pathname: "/ws" |
| 46 | + # port: 8080 |
| 47 | + # Should we use gzip compression? |
32 | 48 | compress: true |
| 49 | + # Note that apps that do not check the host are vulnerable to DNS rebinding attacks |
33 | 50 | allowed_hosts: all |
34 | 51 | pretty: true |
35 | 52 | headers: |
36 | 53 | Access-Control-Allow-Origin: "*" |
37 | 54 | static: |
38 | 55 | watch: |
39 | 56 | ignored: "**/node_modules/**" |
40 | | - swc: true |
| 57 | + |
41 | 58 | test: |
42 | | - source_path: client/app |
43 | | - source_entry_path: packs |
44 | | - public_root_path: public |
45 | | - cache_path: tmp/cache/shakapacker |
46 | | - webpack_compile_output: false |
47 | | - ensure_consistent_versioning: true |
48 | | - additional_paths: *1 |
49 | | - cache_manifest: false |
50 | | - nested_entries: true |
| 59 | + <<: *default |
51 | 60 | compile: false |
| 61 | + |
| 62 | + # Compile test packs to a separate directory |
52 | 63 | public_output_path: webpack/test |
53 | | - swc: true |
| 64 | + |
54 | 65 | production: |
55 | | - source_path: client/app |
56 | | - source_entry_path: packs |
57 | | - public_root_path: public |
58 | | - cache_path: tmp/cache/shakapacker |
59 | | - webpack_compile_output: false |
60 | | - ensure_consistent_versioning: true |
61 | | - additional_paths: *1 |
62 | | - cache_manifest: true |
63 | | - nested_entries: true |
| 66 | + <<: *default |
| 67 | + |
64 | 68 | public_output_path: webpack/production |
| 69 | + |
| 70 | + # Production depends on precompilation of packs prior to booting for performance. |
65 | 71 | compile: false |
66 | | - swc: true |
| 72 | + |
| 73 | + # Cache manifest.json for performance |
| 74 | + cache_manifest: true |
0 commit comments