Skip to content

Commit

Permalink
entirely remove Webpacker and Webpack -- we use vite now
Browse files Browse the repository at this point in the history
  • Loading branch information
jrochkind committed Oct 13, 2022
1 parent 51766d6 commit 3a35f51
Show file tree
Hide file tree
Showing 14 changed files with 387 additions and 7,425 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ gem 'lockbox'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.1.1'
gem 'webpacker', '~> 5.0'

# Our JS/CSS/asset bundler
gem "vite_rails", "~> 3.0"
Expand Down
7 changes: 0 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,6 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
semantic_range (3.0.0)
shrine (3.4.0)
content_disposition (~> 1.0)
down (~> 5.1)
Expand Down Expand Up @@ -688,11 +687,6 @@ GEM
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webpacker (5.4.3)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
webrick (1.7.0)
websocket (1.2.9)
websocket-driver (0.7.5)
Expand Down Expand Up @@ -794,7 +788,6 @@ DEPENDENCIES
web-console (>= 4.1.0)
webdrivers
webmock (~> 3.5)
webpacker (~> 5.0)

RUBY VERSION
ruby 3.0.4p208
Expand Down
5 changes: 2 additions & 3 deletions app/views/layouts/admin.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
Right now, even though we have separate layout for 'admin', we do _not_ segregate
our CSS and JS assets, only the single pipelined application.js and application.css,
with JS/CSS shared by both. (Currently the general 'application' layout is not
loading our webpacker JS, but that could change.)
with JS/CSS shared by both.
%>

<html>
Expand All @@ -18,7 +17,7 @@
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%# Instead of loading via webpacker, we are loading uppy the heavy-weight way manually
<%# Instead of loading via local build, we are loading uppy the heavy-weight way manually
from CDN. For somewhat 'legacy' reasons. We may 'fix' this in future.
Uppy recommends against this, but we're doing it for now, until we get it working
Expand Down
18 changes: 0 additions & 18 deletions bin/webpack

This file was deleted.

18 changes: 0 additions & 18 deletions bin/webpack-dev-server

This file was deleted.

11 changes: 3 additions & 8 deletions config/initializers/content_security_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy

Rails.application.config.content_security_policy do |policy|
# webpacker-recommended for dev, we added test
if Rails.env.development? || Rails.env.test?
policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035"
# Allow @vite/client to hot reload changes in development
# policy.connect_src *policy.connect_src, "ws://#{ ViteRuby.config.host_with_port }" if Rails.env.development?

end

# policy.connect_src *policy.connect_src, "ws://#{ ViteRuby.config.host_with_port }" if Rails.env.development?

# policy.default_src :self, :https
# policy.font_src :self, :https, :data
Expand All @@ -24,7 +18,8 @@
# vite-rails suggestions:

# Allow @vite/client to hot reload javascript changes in development
# policy.script_src *policy.script_src, :unsafe_eval, "http://#{ ViteRuby.config.host_with_port }" if Rails.env.development?

#policy.script_src *policy.script_src, :unsafe_eval, "http://#{ ViteRuby.config.host_with_port }" if Rails.env.development?

# You may need to enable this in production as well depending on your setup.
# policy.script_src *policy.script_src, :blob if Rails.env.test?
Expand Down
5 changes: 0 additions & 5 deletions config/webpack/development.js

This file was deleted.

17 changes: 0 additions & 17 deletions config/webpack/environment.js

This file was deleted.

5 changes: 0 additions & 5 deletions config/webpack/production.js

This file was deleted.

5 changes: 0 additions & 5 deletions config/webpack/test.js

This file was deleted.

96 changes: 0 additions & 96 deletions config/webpacker.yml

This file was deleted.

8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "scihist_digicoll",
"private": true,
"dependencies": {
"@rails/webpacker": "^5.3.0",
"@shopify/draggable": "^1.0.0-beta.8",
"devbridge-autocomplete": "^1.4.10",
"domready": "^1.0.8",
Expand All @@ -18,12 +17,7 @@
},
"devDependencies": {
"vite": "^3.0.0",
"vite-plugin-ruby": "^3.1.0",
"webpack-dev-server": "^3.11.2"
},
"resolutions": {
"lodash.template": ">= 4.5.0",
"js-yaml": ">= 3.13.1"
"vite-plugin-ruby": "^3.1.0"
},
"browserslist": [
"defaults"
Expand Down
12 changes: 0 additions & 12 deletions postcss.config.js

This file was deleted.

Loading

0 comments on commit 3a35f51

Please sign in to comment.