tiny-lite-sys 0.0.1
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 +7 -0
- data/tiny-lite-sys.gemspec +11 -0
- data/webpacker-5.4.4/CHANGELOG.md +1074 -0
- data/webpacker-5.4.4/CONTRIBUTING.md +33 -0
- data/webpacker-5.4.4/Gemfile +13 -0
- data/webpacker-5.4.4/Gemfile.lock +183 -0
- data/webpacker-5.4.4/MIT-LICENSE +20 -0
- data/webpacker-5.4.4/README.md +427 -0
- data/webpacker-5.4.4/Rakefile +11 -0
- data/webpacker-5.4.4/docs/assets.md +119 -0
- data/webpacker-5.4.4/docs/cloud9.md +310 -0
- data/webpacker-5.4.4/docs/css.md +308 -0
- data/webpacker-5.4.4/docs/deployment.md +130 -0
- data/webpacker-5.4.4/docs/docker.md +68 -0
- data/webpacker-5.4.4/docs/engines.md +213 -0
- data/webpacker-5.4.4/docs/env.md +63 -0
- data/webpacker-5.4.4/docs/es6.md +72 -0
- data/webpacker-5.4.4/docs/folder-structure.md +66 -0
- data/webpacker-5.4.4/docs/integrations.md +220 -0
- data/webpacker-5.4.4/docs/misc.md +23 -0
- data/webpacker-5.4.4/docs/props.md +223 -0
- data/webpacker-5.4.4/docs/target.md +22 -0
- data/webpacker-5.4.4/docs/testing.md +136 -0
- data/webpacker-5.4.4/docs/troubleshooting.md +158 -0
- data/webpacker-5.4.4/docs/typescript.md +190 -0
- data/webpacker-5.4.4/docs/v4-upgrade.md +142 -0
- data/webpacker-5.4.4/docs/webpack-dev-server.md +92 -0
- data/webpacker-5.4.4/docs/webpack.md +364 -0
- data/webpacker-5.4.4/docs/yarn.md +23 -0
- data/webpacker-5.4.4/gemfiles/Gemfile-rails-edge +12 -0
- data/webpacker-5.4.4/gemfiles/Gemfile-rails.5.2.x +9 -0
- data/webpacker-5.4.4/gemfiles/Gemfile-rails.6.0.x +9 -0
- data/webpacker-5.4.4/lib/install/angular.rb +23 -0
- data/webpacker-5.4.4/lib/install/bin/webpack +18 -0
- data/webpacker-5.4.4/lib/install/bin/webpack-dev-server +18 -0
- data/webpacker-5.4.4/lib/install/binstubs.rb +4 -0
- data/webpacker-5.4.4/lib/install/coffee.rb +25 -0
- data/webpacker-5.4.4/lib/install/config/babel.config.js +82 -0
- data/webpacker-5.4.4/lib/install/config/postcss.config.js +12 -0
- data/webpacker-5.4.4/lib/install/config/webpack/development.js +5 -0
- data/webpacker-5.4.4/lib/install/config/webpack/environment.js +3 -0
- data/webpacker-5.4.4/lib/install/config/webpack/production.js +5 -0
- data/webpacker-5.4.4/lib/install/config/webpack/test.js +5 -0
- data/webpacker-5.4.4/lib/install/config/webpacker.yml +92 -0
- data/webpacker-5.4.4/lib/install/elm.rb +39 -0
- data/webpacker-5.4.4/lib/install/erb.rb +25 -0
- data/webpacker-5.4.4/lib/install/examples/angular/hello_angular/app/app.component.ts +9 -0
- data/webpacker-5.4.4/lib/install/examples/angular/hello_angular/app/app.module.ts +16 -0
- data/webpacker-5.4.4/lib/install/examples/angular/hello_angular/index.ts +8 -0
- data/webpacker-5.4.4/lib/install/examples/angular/hello_angular/polyfills.ts +73 -0
- data/webpacker-5.4.4/lib/install/examples/angular/hello_angular.js +7 -0
- data/webpacker-5.4.4/lib/install/examples/coffee/hello_coffee.coffee +4 -0
- data/webpacker-5.4.4/lib/install/examples/elm/Main.elm +55 -0
- data/webpacker-5.4.4/lib/install/examples/elm/hello_elm.js +16 -0
- data/webpacker-5.4.4/lib/install/examples/erb/hello_erb.js.erb +6 -0
- data/webpacker-5.4.4/lib/install/examples/react/babel.config.js +99 -0
- data/webpacker-5.4.4/lib/install/examples/react/hello_react.jsx +26 -0
- data/webpacker-5.4.4/lib/install/examples/react/tsconfig.json +21 -0
- data/webpacker-5.4.4/lib/install/examples/stimulus/application.js +1 -0
- data/webpacker-5.4.4/lib/install/examples/stimulus/controllers/hello_controller.js +18 -0
- data/webpacker-5.4.4/lib/install/examples/stimulus/controllers/index.js +9 -0
- data/webpacker-5.4.4/lib/install/examples/svelte/app.svelte +11 -0
- data/webpacker-5.4.4/lib/install/examples/svelte/hello_svelte.js +20 -0
- data/webpacker-5.4.4/lib/install/examples/typescript/hello_typescript.ts +4 -0
- data/webpacker-5.4.4/lib/install/examples/typescript/tsconfig.json +24 -0
- data/webpacker-5.4.4/lib/install/examples/vue/app.vue +22 -0
- data/webpacker-5.4.4/lib/install/examples/vue/hello_vue.js +72 -0
- data/webpacker-5.4.4/lib/install/javascript/packs/application.js +18 -0
- data/webpacker-5.4.4/lib/install/loaders/coffee.js +6 -0
- data/webpacker-5.4.4/lib/install/loaders/elm.js +25 -0
- data/webpacker-5.4.4/lib/install/loaders/erb.js +11 -0
- data/webpacker-5.4.4/lib/install/loaders/svelte.js +9 -0
- data/webpacker-5.4.4/lib/install/loaders/vue.js +6 -0
- data/webpacker-5.4.4/lib/install/react.rb +18 -0
- data/webpacker-5.4.4/lib/install/stimulus.rb +12 -0
- data/webpacker-5.4.4/lib/install/svelte.rb +29 -0
- data/webpacker-5.4.4/lib/install/template.rb +63 -0
- data/webpacker-5.4.4/lib/install/typescript.rb +39 -0
- data/webpacker-5.4.4/lib/install/vue.rb +49 -0
- data/webpacker-5.4.4/lib/tasks/installers.rake +42 -0
- data/webpacker-5.4.4/lib/tasks/webpacker/binstubs.rake +13 -0
- data/webpacker-5.4.4/lib/tasks/webpacker/check_binstubs.rake +12 -0
- data/webpacker-5.4.4/lib/tasks/webpacker/check_node.rake +31 -0
- data/webpacker-5.4.4/lib/tasks/webpacker/check_yarn.rake +30 -0
- data/webpacker-5.4.4/lib/tasks/webpacker/clean.rake +25 -0
- data/webpacker-5.4.4/lib/tasks/webpacker/clobber.rake +20 -0
- data/webpacker-5.4.4/lib/tasks/webpacker/compile.rake +43 -0
- data/webpacker-5.4.4/lib/tasks/webpacker/info.rake +19 -0
- data/webpacker-5.4.4/lib/tasks/webpacker/install.rake +13 -0
- data/webpacker-5.4.4/lib/tasks/webpacker/verify_install.rake +13 -0
- data/webpacker-5.4.4/lib/tasks/webpacker/yarn_install.rake +16 -0
- data/webpacker-5.4.4/lib/tasks/webpacker.rake +28 -0
- data/webpacker-5.4.4/lib/webpacker/commands.rb +74 -0
- data/webpacker-5.4.4/lib/webpacker/compiler.rb +111 -0
- data/webpacker-5.4.4/lib/webpacker/configuration.rb +128 -0
- data/webpacker-5.4.4/lib/webpacker/dev_server.rb +66 -0
- data/webpacker-5.4.4/lib/webpacker/dev_server_proxy.rb +33 -0
- data/webpacker-5.4.4/lib/webpacker/dev_server_runner.rb +72 -0
- data/webpacker-5.4.4/lib/webpacker/env.rb +43 -0
- data/webpacker-5.4.4/lib/webpacker/helper.rb +195 -0
- data/webpacker-5.4.4/lib/webpacker/instance.rb +37 -0
- data/webpacker-5.4.4/lib/webpacker/manifest.rb +118 -0
- data/webpacker-5.4.4/lib/webpacker/railtie.rb +55 -0
- data/webpacker-5.4.4/lib/webpacker/runner.rb +23 -0
- data/webpacker-5.4.4/lib/webpacker/version.rb +4 -0
- data/webpacker-5.4.4/lib/webpacker/webpack_runner.rb +32 -0
- data/webpacker-5.4.4/lib/webpacker.rb +46 -0
- data/webpacker-5.4.4/package/__tests__/config.js +66 -0
- data/webpacker-5.4.4/package/__tests__/dev_server.js +45 -0
- data/webpacker-5.4.4/package/__tests__/development.js +43 -0
- data/webpacker-5.4.4/package/__tests__/env.js +46 -0
- data/webpacker-5.4.4/package/__tests__/production.js +29 -0
- data/webpacker-5.4.4/package/__tests__/staging.js +29 -0
- data/webpacker-5.4.4/package/__tests__/test.js +26 -0
- data/webpacker-5.4.4/package/config.js +40 -0
- data/webpacker-5.4.4/package/configPath.js +3 -0
- data/webpacker-5.4.4/package/config_types/__tests__/config_list.js +118 -0
- data/webpacker-5.4.4/package/config_types/__tests__/config_object.js +43 -0
- data/webpacker-5.4.4/package/config_types/config_list.js +75 -0
- data/webpacker-5.4.4/package/config_types/config_object.js +55 -0
- data/webpacker-5.4.4/package/config_types/index.js +7 -0
- data/webpacker-5.4.4/package/dev_server.js +20 -0
- data/webpacker-5.4.4/package/env.js +18 -0
- data/webpacker-5.4.4/package/environments/__tests__/base.js +101 -0
- data/webpacker-5.4.4/package/environments/base.js +176 -0
- data/webpacker-5.4.4/package/environments/development.js +53 -0
- data/webpacker-5.4.4/package/environments/production.js +77 -0
- data/webpacker-5.4.4/package/environments/test.js +3 -0
- data/webpacker-5.4.4/package/index.js +24 -0
- data/webpacker-5.4.4/package/rules/babel.js +28 -0
- data/webpacker-5.4.4/package/rules/css.js +3 -0
- data/webpacker-5.4.4/package/rules/file.js +21 -0
- data/webpacker-5.4.4/package/rules/index.js +20 -0
- data/webpacker-5.4.4/package/rules/module.css.js +3 -0
- data/webpacker-5.4.4/package/rules/module.sass.js +8 -0
- data/webpacker-5.4.4/package/rules/node_modules.js +22 -0
- data/webpacker-5.4.4/package/rules/sass.js +17 -0
- data/webpacker-5.4.4/package/utils/__tests__/deep_assign.js +32 -0
- data/webpacker-5.4.4/package/utils/__tests__/deep_merge.js +10 -0
- data/webpacker-5.4.4/package/utils/__tests__/get_style_rule.js +65 -0
- data/webpacker-5.4.4/package/utils/__tests__/objectify.js +9 -0
- data/webpacker-5.4.4/package/utils/deep_assign.js +22 -0
- data/webpacker-5.4.4/package/utils/deep_merge.js +22 -0
- data/webpacker-5.4.4/package/utils/get_style_rule.js +45 -0
- data/webpacker-5.4.4/package/utils/helpers.js +58 -0
- data/webpacker-5.4.4/package/utils/objectify.js +3 -0
- data/webpacker-5.4.4/package.json +82 -0
- data/webpacker-5.4.4/test/command_test.rb +33 -0
- data/webpacker-5.4.4/test/compiler_test.rb +80 -0
- data/webpacker-5.4.4/test/configuration_test.rb +109 -0
- data/webpacker-5.4.4/test/dev_server_runner_test.rb +51 -0
- data/webpacker-5.4.4/test/dev_server_test.rb +47 -0
- data/webpacker-5.4.4/test/env_test.rb +23 -0
- data/webpacker-5.4.4/test/helper_test.rb +157 -0
- data/webpacker-5.4.4/test/manifest_test.rb +73 -0
- data/webpacker-5.4.4/test/rake_tasks_test.rb +80 -0
- data/webpacker-5.4.4/test/test_app/Rakefile +3 -0
- data/webpacker-5.4.4/test/test_app/app/javascript/packs/application.js +10 -0
- data/webpacker-5.4.4/test/test_app/app/javascript/packs/multi_entry.css +4 -0
- data/webpacker-5.4.4/test/test_app/app/javascript/packs/multi_entry.js +4 -0
- data/webpacker-5.4.4/test/test_app/bin/webpack +14 -0
- data/webpacker-5.4.4/test/test_app/bin/webpack-dev-server +14 -0
- data/webpacker-5.4.4/test/test_app/config/application.rb +11 -0
- data/webpacker-5.4.4/test/test_app/config/environment.rb +4 -0
- data/webpacker-5.4.4/test/test_app/config/webpack/development.js +0 -0
- data/webpacker-5.4.4/test/test_app/config/webpacker.yml +103 -0
- data/webpacker-5.4.4/test/test_app/config/webpacker_public_root.yml +19 -0
- data/webpacker-5.4.4/test/test_app/config.ru +5 -0
- data/webpacker-5.4.4/test/test_app/package.json +13 -0
- data/webpacker-5.4.4/test/test_app/public/packs/manifest.json +32 -0
- data/webpacker-5.4.4/test/test_app/yarn.lock +11 -0
- data/webpacker-5.4.4/test/test_helper.rb +33 -0
- data/webpacker-5.4.4/test/webpack_runner_test.rb +51 -0
- data/webpacker-5.4.4/test/webpacker_test.rb +13 -0
- data/webpacker-5.4.4/webpacker.gemspec +31 -0
- data/webpacker-5.4.4/yarn.lock +8271 -0
- metadata +215 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
## Setting Up a Development Environment
|
|
2
|
+
|
|
3
|
+
1. Install [Yarn](https://yarnpkg.com/)
|
|
4
|
+
|
|
5
|
+
2. Run the following commands to set up the development environment.
|
|
6
|
+
```
|
|
7
|
+
bundle install
|
|
8
|
+
yarn
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Making sure your changes pass all tests
|
|
12
|
+
There are a number of automated checks which run on Github Actions when a pull request is created.
|
|
13
|
+
You can run those checks on your own locally to make sure that your changes would not break the CI build.
|
|
14
|
+
|
|
15
|
+
### 1. Check the code for JavaScript style violations
|
|
16
|
+
```
|
|
17
|
+
yarn lint
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### 2. Check the code for Ruby style violations
|
|
21
|
+
```
|
|
22
|
+
bundle exec rubocop
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 3. Run the JavaScript test suite
|
|
26
|
+
```
|
|
27
|
+
yarn test
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 4. Run the Ruby test suite
|
|
31
|
+
```
|
|
32
|
+
bundle exec rake test
|
|
33
|
+
```
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
webpacker (5.4.4)
|
|
5
|
+
activesupport (>= 5.2)
|
|
6
|
+
rack-proxy (>= 0.6.1)
|
|
7
|
+
railties (>= 5.2)
|
|
8
|
+
semantic_range (>= 2.3.0)
|
|
9
|
+
|
|
10
|
+
GEM
|
|
11
|
+
remote: https://rubygems.org/
|
|
12
|
+
specs:
|
|
13
|
+
actioncable (6.1.3.2)
|
|
14
|
+
actionpack (= 6.1.3.2)
|
|
15
|
+
activesupport (= 6.1.3.2)
|
|
16
|
+
nio4r (~> 2.0)
|
|
17
|
+
websocket-driver (>= 0.6.1)
|
|
18
|
+
actionmailbox (6.1.3.2)
|
|
19
|
+
actionpack (= 6.1.3.2)
|
|
20
|
+
activejob (= 6.1.3.2)
|
|
21
|
+
activerecord (= 6.1.3.2)
|
|
22
|
+
activestorage (= 6.1.3.2)
|
|
23
|
+
activesupport (= 6.1.3.2)
|
|
24
|
+
mail (>= 2.7.1)
|
|
25
|
+
actionmailer (6.1.3.2)
|
|
26
|
+
actionpack (= 6.1.3.2)
|
|
27
|
+
actionview (= 6.1.3.2)
|
|
28
|
+
activejob (= 6.1.3.2)
|
|
29
|
+
activesupport (= 6.1.3.2)
|
|
30
|
+
mail (~> 2.5, >= 2.5.4)
|
|
31
|
+
rails-dom-testing (~> 2.0)
|
|
32
|
+
actionpack (6.1.3.2)
|
|
33
|
+
actionview (= 6.1.3.2)
|
|
34
|
+
activesupport (= 6.1.3.2)
|
|
35
|
+
rack (~> 2.0, >= 2.0.9)
|
|
36
|
+
rack-test (>= 0.6.3)
|
|
37
|
+
rails-dom-testing (~> 2.0)
|
|
38
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
|
39
|
+
actiontext (6.1.3.2)
|
|
40
|
+
actionpack (= 6.1.3.2)
|
|
41
|
+
activerecord (= 6.1.3.2)
|
|
42
|
+
activestorage (= 6.1.3.2)
|
|
43
|
+
activesupport (= 6.1.3.2)
|
|
44
|
+
nokogiri (>= 1.8.5)
|
|
45
|
+
actionview (6.1.3.2)
|
|
46
|
+
activesupport (= 6.1.3.2)
|
|
47
|
+
builder (~> 3.1)
|
|
48
|
+
erubi (~> 1.4)
|
|
49
|
+
rails-dom-testing (~> 2.0)
|
|
50
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
|
51
|
+
activejob (6.1.3.2)
|
|
52
|
+
activesupport (= 6.1.3.2)
|
|
53
|
+
globalid (>= 0.3.6)
|
|
54
|
+
activemodel (6.1.3.2)
|
|
55
|
+
activesupport (= 6.1.3.2)
|
|
56
|
+
activerecord (6.1.3.2)
|
|
57
|
+
activemodel (= 6.1.3.2)
|
|
58
|
+
activesupport (= 6.1.3.2)
|
|
59
|
+
activestorage (6.1.3.2)
|
|
60
|
+
actionpack (= 6.1.3.2)
|
|
61
|
+
activejob (= 6.1.3.2)
|
|
62
|
+
activerecord (= 6.1.3.2)
|
|
63
|
+
activesupport (= 6.1.3.2)
|
|
64
|
+
marcel (~> 1.0.0)
|
|
65
|
+
mini_mime (~> 1.0.2)
|
|
66
|
+
activesupport (6.1.3.2)
|
|
67
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
68
|
+
i18n (>= 1.6, < 2)
|
|
69
|
+
minitest (>= 5.1)
|
|
70
|
+
tzinfo (~> 2.0)
|
|
71
|
+
zeitwerk (~> 2.3)
|
|
72
|
+
ast (2.4.2)
|
|
73
|
+
builder (3.2.4)
|
|
74
|
+
byebug (11.1.3)
|
|
75
|
+
concurrent-ruby (1.1.8)
|
|
76
|
+
crass (1.0.6)
|
|
77
|
+
erubi (1.10.0)
|
|
78
|
+
globalid (0.4.2)
|
|
79
|
+
activesupport (>= 4.2.0)
|
|
80
|
+
i18n (1.8.10)
|
|
81
|
+
concurrent-ruby (~> 1.0)
|
|
82
|
+
loofah (2.9.1)
|
|
83
|
+
crass (~> 1.0.2)
|
|
84
|
+
nokogiri (>= 1.5.9)
|
|
85
|
+
mail (2.7.1)
|
|
86
|
+
mini_mime (>= 0.1.1)
|
|
87
|
+
marcel (1.0.1)
|
|
88
|
+
method_source (1.0.0)
|
|
89
|
+
mini_mime (1.0.3)
|
|
90
|
+
mini_portile2 (2.5.1)
|
|
91
|
+
minitest (5.14.4)
|
|
92
|
+
nio4r (2.5.7)
|
|
93
|
+
nokogiri (1.11.4)
|
|
94
|
+
mini_portile2 (~> 2.5.0)
|
|
95
|
+
racc (~> 1.4)
|
|
96
|
+
parallel (1.20.1)
|
|
97
|
+
parser (3.0.1.1)
|
|
98
|
+
ast (~> 2.4.1)
|
|
99
|
+
racc (1.5.2)
|
|
100
|
+
rack (2.2.3)
|
|
101
|
+
rack-proxy (0.6.5)
|
|
102
|
+
rack
|
|
103
|
+
rack-test (1.1.0)
|
|
104
|
+
rack (>= 1.0, < 3)
|
|
105
|
+
rails (6.1.3.2)
|
|
106
|
+
actioncable (= 6.1.3.2)
|
|
107
|
+
actionmailbox (= 6.1.3.2)
|
|
108
|
+
actionmailer (= 6.1.3.2)
|
|
109
|
+
actionpack (= 6.1.3.2)
|
|
110
|
+
actiontext (= 6.1.3.2)
|
|
111
|
+
actionview (= 6.1.3.2)
|
|
112
|
+
activejob (= 6.1.3.2)
|
|
113
|
+
activemodel (= 6.1.3.2)
|
|
114
|
+
activerecord (= 6.1.3.2)
|
|
115
|
+
activestorage (= 6.1.3.2)
|
|
116
|
+
activesupport (= 6.1.3.2)
|
|
117
|
+
bundler (>= 1.15.0)
|
|
118
|
+
railties (= 6.1.3.2)
|
|
119
|
+
sprockets-rails (>= 2.0.0)
|
|
120
|
+
rails-dom-testing (2.0.3)
|
|
121
|
+
activesupport (>= 4.2.0)
|
|
122
|
+
nokogiri (>= 1.6)
|
|
123
|
+
rails-html-sanitizer (1.3.0)
|
|
124
|
+
loofah (~> 2.3)
|
|
125
|
+
railties (6.1.3.2)
|
|
126
|
+
actionpack (= 6.1.3.2)
|
|
127
|
+
activesupport (= 6.1.3.2)
|
|
128
|
+
method_source
|
|
129
|
+
rake (>= 0.8.7)
|
|
130
|
+
thor (~> 1.0)
|
|
131
|
+
rainbow (3.0.0)
|
|
132
|
+
rake (13.0.3)
|
|
133
|
+
regexp_parser (2.1.1)
|
|
134
|
+
rexml (3.2.5)
|
|
135
|
+
rubocop (0.93.1)
|
|
136
|
+
parallel (~> 1.10)
|
|
137
|
+
parser (>= 2.7.1.5)
|
|
138
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
139
|
+
regexp_parser (>= 1.8)
|
|
140
|
+
rexml
|
|
141
|
+
rubocop-ast (>= 0.6.0)
|
|
142
|
+
ruby-progressbar (~> 1.7)
|
|
143
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
|
144
|
+
rubocop-ast (1.5.0)
|
|
145
|
+
parser (>= 3.0.1.1)
|
|
146
|
+
rubocop-performance (1.10.2)
|
|
147
|
+
rubocop (>= 0.90.0, < 2.0)
|
|
148
|
+
rubocop-ast (>= 0.4.0)
|
|
149
|
+
ruby-progressbar (1.11.0)
|
|
150
|
+
semantic_range (3.0.0)
|
|
151
|
+
sprockets (4.0.2)
|
|
152
|
+
concurrent-ruby (~> 1.0)
|
|
153
|
+
rack (> 1, < 3)
|
|
154
|
+
sprockets-rails (3.2.2)
|
|
155
|
+
actionpack (>= 4.0)
|
|
156
|
+
activesupport (>= 4.0)
|
|
157
|
+
sprockets (>= 3.0.0)
|
|
158
|
+
thor (1.1.0)
|
|
159
|
+
tzinfo (2.0.4)
|
|
160
|
+
concurrent-ruby (~> 1.0)
|
|
161
|
+
unicode-display_width (1.7.0)
|
|
162
|
+
websocket-driver (0.7.3)
|
|
163
|
+
websocket-extensions (>= 0.1.0)
|
|
164
|
+
websocket-extensions (0.1.5)
|
|
165
|
+
zeitwerk (2.4.2)
|
|
166
|
+
|
|
167
|
+
PLATFORMS
|
|
168
|
+
ruby
|
|
169
|
+
|
|
170
|
+
DEPENDENCIES
|
|
171
|
+
bundler (>= 1.3.0)
|
|
172
|
+
byebug
|
|
173
|
+
minitest (~> 5.0)
|
|
174
|
+
rack-proxy
|
|
175
|
+
rails
|
|
176
|
+
rake (>= 11.1)
|
|
177
|
+
rubocop (= 0.93.1)
|
|
178
|
+
rubocop-performance
|
|
179
|
+
semantic_range
|
|
180
|
+
webpacker!
|
|
181
|
+
|
|
182
|
+
BUNDLED WITH
|
|
183
|
+
2.2.3
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2016-2019 David Heinemeier Hansson, Basecamp
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
# Webpacker
|
|
2
|
+
|
|
3
|
+
[](https://github.com/rails/webpacker/actions)
|
|
4
|
+
[](https://github.com/rails/webpacker/actions)
|
|
5
|
+
[](https://github.com/rails/webpacker/actions)
|
|
6
|
+
[](https://github.com/rails/webpacker/actions)
|
|
7
|
+
|
|
8
|
+
[](https://www.npmjs.com/package/@rails/webpacker)
|
|
9
|
+
[](https://rubygems.org/gems/webpacker)
|
|
10
|
+
|
|
11
|
+
Webpacker makes it easy to use the JavaScript pre-processor and bundler
|
|
12
|
+
[webpack 4.x.x+](https://webpack.js.org/)
|
|
13
|
+
to manage application-like JavaScript in Rails. It coexists with the asset pipeline,
|
|
14
|
+
as the primary purpose for webpack is app-like JavaScript, not images, CSS, or
|
|
15
|
+
even JavaScript Sprinkles (that all continues to live in app/assets).
|
|
16
|
+
|
|
17
|
+
However, it is possible to use Webpacker for CSS, images and fonts assets as well,
|
|
18
|
+
in which case you may not even need the asset pipeline. This is mostly relevant when exclusively using component-based JavaScript frameworks.
|
|
19
|
+
|
|
20
|
+
**NOTE:** The master branch now hosts the code for v5.x.x. Please refer to [4-x-stable](https://github.com/rails/webpacker/tree/4-x-stable) branch for 4.x documentation.
|
|
21
|
+
|
|
22
|
+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
23
|
+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
24
|
+
|
|
25
|
+
## Table of Contents
|
|
26
|
+
|
|
27
|
+
- [Prerequisites](#prerequisites)
|
|
28
|
+
- [Features](#features)
|
|
29
|
+
- [Installation](#installation)
|
|
30
|
+
- [Usage](#usage)
|
|
31
|
+
- [Development](#development)
|
|
32
|
+
- [Webpack Configuration](#webpack-configuration)
|
|
33
|
+
- [Custom Rails environments](#custom-rails-environments)
|
|
34
|
+
- [Upgrading](#upgrading)
|
|
35
|
+
- [Integrations](#integrations)
|
|
36
|
+
- [React](./docs/integrations.md#react)
|
|
37
|
+
- [Angular with TypeScript](./docs/integrations.md#angular-with-typescript)
|
|
38
|
+
- [Vue](./docs/integrations.md#vue)
|
|
39
|
+
- [Elm](./docs/integrations.md#elm)
|
|
40
|
+
- [Stimulus](./docs/integrations.md#stimulus)
|
|
41
|
+
- [Svelte](./docs/integrations.md#svelte)
|
|
42
|
+
- [Typescript](./docs/typescript.md)
|
|
43
|
+
- [CoffeeScript](./docs/integrations.md#coffeescript)
|
|
44
|
+
- [Erb](./docs/integrations.md#erb)
|
|
45
|
+
- [Paths](#paths)
|
|
46
|
+
- [Resolved](#resolved)
|
|
47
|
+
- [Watched](#watched)
|
|
48
|
+
- [Deployment](#deployment)
|
|
49
|
+
- [Docs](#docs)
|
|
50
|
+
- [Contributing](#contributing)
|
|
51
|
+
- [License](#license)
|
|
52
|
+
|
|
53
|
+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
54
|
+
|
|
55
|
+
## Prerequisites
|
|
56
|
+
|
|
57
|
+
- Ruby 2.4+
|
|
58
|
+
- Rails 5.2+
|
|
59
|
+
- Node.js 10.17.0+
|
|
60
|
+
- Yarn 1.x+
|
|
61
|
+
|
|
62
|
+
## Features
|
|
63
|
+
|
|
64
|
+
- [webpack 4.x.x](https://webpack.js.org/)
|
|
65
|
+
- ES6 with [babel](https://babeljs.io/)
|
|
66
|
+
- Automatic code splitting using multiple entry points
|
|
67
|
+
- Stylesheets - Sass and CSS
|
|
68
|
+
- Images and fonts
|
|
69
|
+
- PostCSS - Auto-Prefixer
|
|
70
|
+
- Asset compression, source-maps, and minification
|
|
71
|
+
- CDN support
|
|
72
|
+
- React, Angular, Elm and Vue support out-of-the-box
|
|
73
|
+
- Rails view helpers
|
|
74
|
+
- Extensible and configurable
|
|
75
|
+
|
|
76
|
+
## Installation
|
|
77
|
+
|
|
78
|
+
You can either add Webpacker during setup of a new Rails 5.1+ application
|
|
79
|
+
using new `--webpack` option:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Available Rails 5.1+
|
|
83
|
+
rails new myapp --webpack
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Or add it to your `Gemfile`:
|
|
87
|
+
|
|
88
|
+
```ruby
|
|
89
|
+
# Gemfile
|
|
90
|
+
gem 'webpacker', '~> 5.x'
|
|
91
|
+
|
|
92
|
+
# OR if you prefer to use master
|
|
93
|
+
gem 'webpacker', git: 'https://github.com/rails/webpacker.git'
|
|
94
|
+
yarn add https://github.com/rails/webpacker.git
|
|
95
|
+
yarn add core-js regenerator-runtime
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Finally, run the following to install Webpacker:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
bundle
|
|
102
|
+
bundle exec rails webpacker:install
|
|
103
|
+
|
|
104
|
+
# OR (on rails version < 5.0)
|
|
105
|
+
bundle exec rake webpacker:install
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Optional: To fix ["unmet peer dependency" warnings](https://github.com/rails/webpacker/issues/1078),
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
yarn upgrade
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
When `package.json` and/or `yarn.lock` changes, such as when pulling down changes to your local environment in a team settings, be sure to keep your NPM packages up-to-date:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
yarn install
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Usage
|
|
121
|
+
|
|
122
|
+
Once installed, you can start writing modern ES6-flavored JavaScript apps right away:
|
|
123
|
+
|
|
124
|
+
```yml
|
|
125
|
+
app/javascript:
|
|
126
|
+
├── packs:
|
|
127
|
+
│ # only webpack entry files here
|
|
128
|
+
│ └── application.js
|
|
129
|
+
│ └── application.css
|
|
130
|
+
└── src:
|
|
131
|
+
│ └── my_component.js
|
|
132
|
+
└── stylesheets:
|
|
133
|
+
│ └── my_styles.css
|
|
134
|
+
└── images:
|
|
135
|
+
└── logo.svg
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
In `/packs/application.js`, include this at the top of the file:
|
|
139
|
+
|
|
140
|
+
```js
|
|
141
|
+
import 'core-js/stable'
|
|
142
|
+
import 'regenerator-runtime/runtime'
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
You can then link the JavaScript pack in Rails views using the `javascript_pack_tag` helper.
|
|
146
|
+
If you have styles imported in your pack file, you can link them by using `stylesheet_pack_tag`:
|
|
147
|
+
|
|
148
|
+
```erb
|
|
149
|
+
<%= javascript_pack_tag 'application' %>
|
|
150
|
+
<%= stylesheet_pack_tag 'application' %>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
If you want to link a static asset for `<link rel="prefetch">` or `<img />` tag, you
|
|
154
|
+
can use the `asset_pack_path` helper:
|
|
155
|
+
|
|
156
|
+
```erb
|
|
157
|
+
<link rel="prefetch" href="<%= asset_pack_path 'application.css' %>" />
|
|
158
|
+
<img src="<%= asset_pack_path 'images/logo.svg' %>" />
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
If you are using new webpack 4 split chunks API, then consider using `javascript_packs_with_chunks_tag` helper, which creates html
|
|
162
|
+
tags for a pack and all the dependent chunks.
|
|
163
|
+
|
|
164
|
+
```erb
|
|
165
|
+
<%= javascript_packs_with_chunks_tag 'calendar', 'map', 'data-turbolinks-track': 'reload' %>
|
|
166
|
+
|
|
167
|
+
<script src="/packs/vendor-16838bab065ae1e314.js" data-turbolinks-track="reload"></script>
|
|
168
|
+
<script src="/packs/calendar~runtime-16838bab065ae1e314.js" data-turbolinks-track="reload"></script>
|
|
169
|
+
<script src="/packs/calendar-1016838bab065ae1e314.js" data-turbolinks-track="reload"></script>
|
|
170
|
+
<script src="/packs/map~runtime-16838bab065ae1e314.js" data-turbolinks-track="reload"></script>
|
|
171
|
+
<script src="/packs/map-16838bab065ae1e314.js" data-turbolinks-track="reload"></script>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Important:** Pass all your pack names when using `javascript_packs_with_chunks_tag`
|
|
175
|
+
helper otherwise you will get duplicated chunks on the page.
|
|
176
|
+
|
|
177
|
+
```erb
|
|
178
|
+
<%# DO %>
|
|
179
|
+
<%= javascript_packs_with_chunks_tag 'calendar', 'map' %>
|
|
180
|
+
|
|
181
|
+
<%# DON'T %>
|
|
182
|
+
<%= javascript_packs_with_chunks_tag 'calendar' %>
|
|
183
|
+
<%= javascript_packs_with_chunks_tag 'map' %>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Note:** In order for your styles or static assets files to be available in your view,
|
|
187
|
+
you would need to link them in your "pack" or entry file.
|
|
188
|
+
|
|
189
|
+
### Development
|
|
190
|
+
|
|
191
|
+
Webpacker ships with two binstubs: `./bin/webpack` and `./bin/webpack-dev-server`.
|
|
192
|
+
Both are thin wrappers around the standard `webpack.js` and `webpack-dev-server.js`
|
|
193
|
+
executables to ensure that the right configuration files and environmental variables
|
|
194
|
+
are loaded based on your environment.
|
|
195
|
+
|
|
196
|
+
In development, Webpacker compiles on demand rather than upfront by default. This
|
|
197
|
+
happens when you refer to any of the pack assets using the Webpacker helper methods.
|
|
198
|
+
This means that you don't have to run any separate processes. Compilation errors are logged
|
|
199
|
+
to the standard Rails log.
|
|
200
|
+
|
|
201
|
+
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/webpack-dev-server` or `ruby ./bin/webpack-dev-server`. Windows users will need to run these commands
|
|
202
|
+
in a terminal separate from `bundle exec rails s`. This process will watch for changes
|
|
203
|
+
in the `app/javascript/packs/*.js` files and automatically reload the browser to match.
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
# webpack dev server
|
|
207
|
+
./bin/webpack-dev-server
|
|
208
|
+
|
|
209
|
+
# watcher
|
|
210
|
+
./bin/webpack --watch --colors --progress
|
|
211
|
+
|
|
212
|
+
# standalone build
|
|
213
|
+
./bin/webpack
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Once you start this development server, Webpacker will automatically start proxying all
|
|
217
|
+
webpack asset requests to this server. When you stop the server, it'll revert back to
|
|
218
|
+
on-demand compilation.
|
|
219
|
+
|
|
220
|
+
You can use environment variables as options supported by
|
|
221
|
+
[webpack-dev-server](https://webpack.js.org/configuration/dev-server/) in the
|
|
222
|
+
form `WEBPACKER_DEV_SERVER_<OPTION>`. Please note that these environmental
|
|
223
|
+
variables will always take precedence over the ones already set in the
|
|
224
|
+
configuration file, and that the _same_ environmental variables must
|
|
225
|
+
be available to the `rails server` process.
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
WEBPACKER_DEV_SERVER_HOST=example.com WEBPACKER_DEV_SERVER_INLINE=true WEBPACKER_DEV_SERVER_HOT=false ./bin/webpack-dev-server
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
By default, the webpack dev server listens on `localhost` in development for security purposes.
|
|
232
|
+
However, if you want your app to be available over local LAN IP or a VM instance like vagrant,
|
|
233
|
+
you can set the `host` when running `./bin/webpack-dev-server` binstub:
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
WEBPACKER_DEV_SERVER_HOST=0.0.0.0 ./bin/webpack-dev-server
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**Note:** You need to allow webpack-dev-server host as an allowed origin for `connect-src` if you are running your application in a restrict CSP environment (like Rails 5.2+). This can be done in Rails 5.2+ in the CSP initializer `config/initializers/content_security_policy.rb` with a snippet like this:
|
|
240
|
+
|
|
241
|
+
```ruby
|
|
242
|
+
Rails.application.config.content_security_policy do |policy|
|
|
243
|
+
policy.connect_src :self, :https, 'http://localhost:3035', 'ws://localhost:3035' if Rails.env.development?
|
|
244
|
+
end
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**Note:** Don't forget to prefix `ruby` when running these binstubs on Windows
|
|
248
|
+
|
|
249
|
+
### Webpack Configuration
|
|
250
|
+
|
|
251
|
+
See [docs/webpack](docs/webpack.md) for modifying webpack configuration and loaders.
|
|
252
|
+
|
|
253
|
+
### Custom Rails environments
|
|
254
|
+
|
|
255
|
+
Out of the box Webpacker ships with - development, test and production environments in `config/webpacker.yml` however, in most production apps extra environments are needed as part of deployment workflow. Webpacker supports this out of the box from version 3.4.0+ onwards.
|
|
256
|
+
|
|
257
|
+
You can choose to define additional environment configurations in webpacker.yml,
|
|
258
|
+
|
|
259
|
+
```yml
|
|
260
|
+
staging:
|
|
261
|
+
<<: *default
|
|
262
|
+
|
|
263
|
+
# Production depends on precompilation of packs prior to booting for performance.
|
|
264
|
+
compile: false
|
|
265
|
+
|
|
266
|
+
# Cache manifest.json for performance
|
|
267
|
+
cache_manifest: true
|
|
268
|
+
|
|
269
|
+
# Compile staging packs to a separate directory
|
|
270
|
+
public_output_path: packs-staging
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
or, Webpacker will use production environment as a fallback environment for loading configurations. Please note, `NODE_ENV` can either be set to `production`, `development` or `test`.
|
|
274
|
+
This means you don't need to create additional environment files inside `config/webpacker/*` and instead use webpacker.yml to load different configurations using `RAILS_ENV`.
|
|
275
|
+
|
|
276
|
+
For example, the below command will compile assets in production mode but will use staging configurations from `config/webpacker.yml` if available or use fallback production environment configuration:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
RAILS_ENV=staging bundle exec rails assets:precompile
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
And, this will compile in development mode and load configuration for cucumber environment
|
|
283
|
+
if defined in webpacker.yml or fallback to production configuration
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
RAILS_ENV=cucumber NODE_ENV=development bundle exec rails assets:precompile
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Please note, binstubs compiles in development mode however rake tasks
|
|
290
|
+
compiles in production mode.
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
# Compiles in development mode unless NODE_ENV is specified
|
|
294
|
+
./bin/webpack
|
|
295
|
+
./bin/webpack-dev-server
|
|
296
|
+
|
|
297
|
+
# compiles in production mode by default unless NODE_ENV is specified
|
|
298
|
+
bundle exec rails assets:precompile
|
|
299
|
+
bundle exec rails webpacker:compile
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Upgrading
|
|
303
|
+
|
|
304
|
+
You can run following commands to upgrade Webpacker to the latest stable version. This process involves upgrading the gem and related JavaScript packages:
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
bundle update webpacker
|
|
308
|
+
rails webpacker:binstubs
|
|
309
|
+
yarn upgrade @rails/webpacker --latest
|
|
310
|
+
yarn upgrade webpack-dev-server --latest
|
|
311
|
+
|
|
312
|
+
# Or to install the latest release (including pre-releases)
|
|
313
|
+
yarn add @rails/webpacker@next
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## Integrations
|
|
317
|
+
|
|
318
|
+
Webpacker ships with basic out-of-the-box integration. You can see a list of available commands/tasks by running `bundle exec rails webpacker`.
|
|
319
|
+
|
|
320
|
+
Included install integrations:
|
|
321
|
+
|
|
322
|
+
- [React](./docs/integrations.md#React)
|
|
323
|
+
- [Angular with TypeScript](./docs/integrations.md#Angular-with-TypeScript)
|
|
324
|
+
- [Vue](./docs/integrations.md#Vue)
|
|
325
|
+
- [Elm](./docs/integrations.md#Elm)
|
|
326
|
+
- [Svelte](./docs/integrations.md#Svelte)
|
|
327
|
+
- [Stimulus](./docs/integrations.md#Stimulus)
|
|
328
|
+
- [CoffeeScript](./docs/integrations.md#CoffeeScript)
|
|
329
|
+
- [Typescript](./docs/typescript.md)
|
|
330
|
+
- [Erb](./docs/integrations.md#Erb)
|
|
331
|
+
|
|
332
|
+
See [Integrations](./docs/integrations.md) for further details.
|
|
333
|
+
|
|
334
|
+
## Paths
|
|
335
|
+
|
|
336
|
+
By default, Webpacker ships with simple conventions for where the JavaScript
|
|
337
|
+
app files and compiled webpack bundles will go in your Rails app.
|
|
338
|
+
All these options are configurable from `config/webpacker.yml` file.
|
|
339
|
+
|
|
340
|
+
The configuration for what webpack is supposed to compile by default rests
|
|
341
|
+
on the convention that every file in `app/javascript/packs/*`**(default)**
|
|
342
|
+
or whatever path you set for `source_entry_path` in the `webpacker.yml` configuration
|
|
343
|
+
is turned into their own output files (or entry points, as webpack calls it). Therefore you don't want to put anything inside `packs` directory that you do not want to be
|
|
344
|
+
an entry file. As a rule of thumb, put all files you want to link in your views inside
|
|
345
|
+
"packs" directory and keep everything else under `app/javascript`.
|
|
346
|
+
|
|
347
|
+
Suppose you want to change the source directory from `app/javascript`
|
|
348
|
+
to `frontend` and output to `assets/packs`. This is how you would do it:
|
|
349
|
+
|
|
350
|
+
```yml
|
|
351
|
+
# config/webpacker.yml
|
|
352
|
+
source_path: frontend
|
|
353
|
+
source_entry_path: packs
|
|
354
|
+
public_output_path: assets/packs # outputs to => public/assets/packs
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
Similarly you can also control and configure `webpack-dev-server` settings from `config/webpacker.yml` file:
|
|
358
|
+
|
|
359
|
+
```yml
|
|
360
|
+
# config/webpacker.yml
|
|
361
|
+
development:
|
|
362
|
+
dev_server:
|
|
363
|
+
host: localhost
|
|
364
|
+
port: 3035
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
If you have `hmr` turned to true, then the `stylesheet_pack_tag` generates no output, as you will want to configure your styles to be inlined in your JavaScript for hot reloading. During production and testing, the `stylesheet_pack_tag` will create the appropriate HTML tags.
|
|
368
|
+
|
|
369
|
+
### Resolved
|
|
370
|
+
|
|
371
|
+
If you are adding Webpacker to an existing app that has most of the assets inside
|
|
372
|
+
`app/assets` or inside an engine, and you want to share that
|
|
373
|
+
with webpack modules, you can use the `additional_paths`
|
|
374
|
+
option available in `config/webpacker.yml`. This lets you
|
|
375
|
+
add additional paths that webpack should lookup when resolving modules:
|
|
376
|
+
|
|
377
|
+
```yml
|
|
378
|
+
additional_paths: ['app/assets']
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
You can then import these items inside your modules like so:
|
|
382
|
+
|
|
383
|
+
```js
|
|
384
|
+
// Note it's relative to parent directory i.e. app/assets
|
|
385
|
+
import 'stylesheets/main'
|
|
386
|
+
import 'images/rails.png'
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
**Note:** Please be careful when adding paths here otherwise it
|
|
390
|
+
will make the compilation slow, consider adding specific paths instead of
|
|
391
|
+
whole parent directory if you just need to reference one or two modules
|
|
392
|
+
|
|
393
|
+
## Deployment
|
|
394
|
+
|
|
395
|
+
Webpacker hooks up a new `webpacker:compile` task to `assets:precompile`, which gets run whenever you run `assets:precompile`. If you are not using Sprockets, `webpacker:compile` is automatically aliased to `assets:precompile`. Similar to sprockets both rake tasks will compile packs in production mode but will use `RAILS_ENV` to load configuration from `config/webpacker.yml` (if available).
|
|
396
|
+
|
|
397
|
+
When compiling assets for production on a remote server, such as a continuous integration environment, it's recommended to use `yarn install --frozen-lockfile` to install NPM packages on the remote host to ensure that the installed packages match the `yarn.lock` file.
|
|
398
|
+
|
|
399
|
+
## Docs
|
|
400
|
+
|
|
401
|
+
- [Development](https://github.com/rails/webpacker#development)
|
|
402
|
+
- [Webpack](./docs/webpack.md)
|
|
403
|
+
- [Webpack-dev-server](./docs/webpack-dev-server.md)
|
|
404
|
+
- [Environment Variables](./docs/env.md)
|
|
405
|
+
- [Folder Structure](./docs/folder-structure.md)
|
|
406
|
+
- [Assets](./docs/assets.md) - [CSS, Sass and SCSS](./docs/css.md) - [ES6](./docs/es6.md), [Target browsers](./docs/target.md)
|
|
407
|
+
- [Props](./docs/props.md)
|
|
408
|
+
- [Typescript](./docs/typescript.md)
|
|
409
|
+
- [Yarn](./docs/yarn.md)
|
|
410
|
+
- [Misc](./docs/misc.md)
|
|
411
|
+
- [Deployment](./docs/deployment.md)
|
|
412
|
+
- [Docker](./docs/docker.md)
|
|
413
|
+
- [Using in Rails engines](./docs/engines.md)
|
|
414
|
+
- [Webpacker on Cloud9](./docs/cloud9.md)
|
|
415
|
+
- [Testing](./docs/testing.md)
|
|
416
|
+
- [Troubleshooting](./docs/troubleshooting.md)
|
|
417
|
+
- [v3 to v4 Upgrade Guide](./docs/v4-upgrade.md)
|
|
418
|
+
|
|
419
|
+
## Contributing
|
|
420
|
+
|
|
421
|
+
[](https://www.codetriage.com/rails/webpacker)
|
|
422
|
+
|
|
423
|
+
We encourage you to contribute to Webpacker! See [CONTRIBUTING](CONTRIBUTING.md) for guidelines about how to proceed.
|
|
424
|
+
|
|
425
|
+
## License
|
|
426
|
+
|
|
427
|
+
Webpacker is released under the [MIT License](https://opensource.org/licenses/MIT).
|