You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**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:
187
187
188
188
```ruby
189
-
p.connect_src :self, :https, 'http://localhost:3035', 'ws://localhost:3035' if Rails.env.development?
189
+
policy.connect_src :self, :https, 'http://localhost:3035', 'ws://localhost:3035' if Rails.env.development?
190
190
```
191
191
192
192
**Note:** Don't forget to prefix `ruby` when running these binstubs on Windows
You can run following commands to upgrade Webpacker to the latest stable version. This process involves upgrading the gem and related npm modules:
251
+
You can run following commands to upgrade Webpacker to the latest stable version. This process involves upgrading the gem and related JavaScript packages:
By default, in development, webpacker runs a yarn integrity check to ensure that all local npm packages are up-to-date. This is similar to what bundler does currently in Rails, but for JavaScript packages. If your system is out of date, then Rails will not initialize. You will be asked to upgrade your local npm packages by running `yarn install`.
261
+
By default, in development, webpacker runs a yarn integrity check to ensure that all local JavaScript packages are up-to-date. This is similar to what bundler does currently in Rails, but for JavaScript packages. If your system is out of date, then Rails will not initialize. You will be asked to upgrade your local JavaScript packages by running `yarn install`.
262
262
263
263
To turn off this option, you will need to override the default by adding a new config option to your Rails development environment configuration file (`config/environment/development.rb`):
264
264
@@ -324,9 +324,9 @@ with the following code:
324
324
325
325
```ruby
326
326
if Rails.env.development?
327
-
p.script_src :self, :https, :unsafe_eval
327
+
policy.script_src :self, :https, :unsafe_eval
328
328
else
329
-
p.script_src :self, :https
329
+
policy.script_src :self, :https
330
330
end
331
331
```
332
332
@@ -352,9 +352,9 @@ configuration:
352
352
353
353
```ruby
354
354
if Rails.env.development?
355
-
p.script_src :self, :https, :unsafe_eval
355
+
policy.script_src :self, :https, :unsafe_eval
356
356
else
357
-
p.script_src :self, :https
357
+
policy.script_src :self, :https
358
358
end
359
359
```
360
360
You can read more about this in the [Vue docs](https://vuejs.org/v2/guide/installation.html#CSP-environments).
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`. Remember to set NODE_ENV environment variable to production during deployment or when running this rake task.
489
+
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).
0 commit comments