webpacker: arreglar webpack-dev-server

This commit is contained in:
void 2021-02-10 16:17:37 +00:00
parent 69f1687962
commit 42dcf06d27
3 changed files with 10 additions and 5 deletions

View file

@ -2,6 +2,7 @@ RAILS_ENV=
IMAP_SERVER= IMAP_SERVER=
DEFAULT_FROM= DEFAULT_FROM=
SKEL_SUTTY=https://0xacab.org/sutty/skel.sutty.nl SKEL_SUTTY=https://0xacab.org/sutty/skel.sutty.nl
# XXX: Si cambiás esta variable, tenés que editar config/webpacker.yml también :(
SUTTY=sutty.local SUTTY=sutty.local
SUTTY_WITH_PORT=sutty.local:3000 SUTTY_WITH_PORT=sutty.local:3000
REDIS_SERVER= REDIS_SERVER=

View file

@ -17,10 +17,11 @@ Rails.application.config.content_security_policy do |policy|
policy.img_src :self, :data, :https, :blob policy.img_src :self, :data, :https, :blob
# Ya no usamos applets! # Ya no usamos applets!
policy.object_src :none policy.object_src :none
# webpack-dev-server
if Rails.env.development? if Rails.env.development?
policy.connect_src :self, policy.connect_src :self,
'http://localhost:3035', "https://#{ENV.fetch('SUTTY', 'sutty.local')}:3035",
'ws://localhost:3035' "wss://#{ENV.fetch('SUTTY', 'sutty.local')}:3035"
end end
# Specify URI for violation reports # Specify URI for violation reports

View file

@ -53,10 +53,13 @@ development:
# Reference: https://webpack.js.org/configuration/dev-server/ # Reference: https://webpack.js.org/configuration/dev-server/
dev_server: dev_server:
https: true https:
host: <%= ENV.fetch('SUTTY', 'localhost') %> key: '../sutty.local/domain/sutty.local.key'
cert: '../sutty.local/domain/sutty.local.crt'
# XXX: esto está hardcodeado, debería conseguirlo del ENV
host: sutty.local
port: 3035 port: 3035
public: <%= ENV.fetch('SUTTY', 'localhost') %>:3035 public: sutty.local:3035
hmr: false hmr: false
# Inline should be set to true if using HMR # Inline should be set to true if using HMR
inline: true inline: true