Skip to content

Commit

Permalink
WIP Upgrade to Webpacker 6.0rc
Browse files Browse the repository at this point in the history
  • Loading branch information
mmx900 committed Apr 21, 2024
1 parent e07ffe0 commit 7daad79
Show file tree
Hide file tree
Showing 9 changed files with 1,609 additions and 2,456 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ gem 'simple_form', '~> 5.0'
gem 'sprockets', '< 4'
gem 'turbolinks'
gem 'uglifier', '>= 1.3.0'
gem 'webpacker', '~> 5'
gem 'webpacker', '6.0.0.rc.6'

group :development, :test do
gem 'better_errors', '~> 2.9.1'
Expand Down
7 changes: 5 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ GEM
nio4r (2.7.0)
nokogiri (1.15.5-aarch64-linux)
racc (~> 1.4)
nokogiri (1.15.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.15.5-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.15.5-x86_64-linux)
Expand Down Expand Up @@ -455,7 +457,7 @@ GEM
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webpacker (5.4.4)
webpacker (6.0.0.rc.6)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
Expand All @@ -470,6 +472,7 @@ GEM

PLATFORMS
aarch64-linux
arm64-darwin-22
x86_64-darwin-19
x86_64-darwin-21
x86_64-linux
Expand Down Expand Up @@ -523,7 +526,7 @@ DEPENDENCIES
tzinfo-data
uglifier (>= 1.3.0)
webmock (~> 3.12.1)
webpacker (~> 5)
webpacker (= 6.0.0.rc.6)

RUBY VERSION
ruby 3.2.2p53
Expand Down
3 changes: 3 additions & 0 deletions config/webpack/base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const { webpackConfig } = require('@rails/webpacker')

module.exports = webpackConfig
4 changes: 2 additions & 2 deletions config/webpack/development.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
process.env.NODE_ENV = process.env.NODE_ENV || 'development'

const environment = require('./environment')
const webpackConfig = require('./base')

module.exports = environment.toWebpackConfig()
module.exports = webpackConfig
4 changes: 2 additions & 2 deletions config/webpack/production.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
process.env.NODE_ENV = process.env.NODE_ENV || 'production'

const environment = require('./environment')
const webpackConfig = require('./base')

module.exports = environment.toWebpackConfig()
module.exports = webpackConfig
4 changes: 2 additions & 2 deletions config/webpack/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
process.env.NODE_ENV = process.env.NODE_ENV || 'development'

const environment = require('./environment')
const webpackConfig = require('./base')

module.exports = environment.toWebpackConfig()
module.exports = webpackConfig
27 changes: 18 additions & 9 deletions config/webpacker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ default: &default
cache_path: tmp/cache/webpacker
webpack_compile_output: true

# Additional paths webpack should lookup modules
# Additional paths webpack should look up modules
# ['app/assets', 'engine/foo/app/assets']
additional_paths: []

Expand Down Expand Up @@ -58,19 +58,28 @@ development:
host: localhost
port: 3035
public: localhost:3035
# Hot Module Replacement updates modules while the application is running without a full reload
hmr: false
# Inline should be set to true if using HMR
inline: true
overlay: true
# Defaults to the inverse of hmr. Uncomment to manually set this.
# live_reload: true
client:
# Should we show a full-screen overlay in the browser when there are compiler errors or warnings?
overlay: true
# May also be a string
# webSocketURL:
# hostname: "0.0.0.0"
# pathname: "/ws"
# port: 8080
# Should we use gzip compression?
compress: true
disable_host_check: true
use_local_ip: false
quiet: false
# Note that apps that do not check the host are vulnerable to DNS rebinding attacks
allowed_hosts: "all"
pretty: false
headers:
'Access-Control-Allow-Origin': '*'
watch_options:
ignored: '**/node_modules/**'
static:
watch:
ignored: '**/node_modules/**'


test:
Expand Down
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"@rails/ujs": "^7.1.2",
"@rails/webpacker": "5.4.0",
"@rails/webpacker": "6.0.0-rc.6",
"bootstrap": "^4.1.1",
"jquery": "^3.3.1",
"jquery-ujs": "^1.2.2",
Expand All @@ -28,5 +28,13 @@
"engines": {
"yarn": "1.x",
"node": "20.x"
}
},
"babel": {
"presets": [
"./node_modules/@rails/webpacker/package/babel/preset.js"
]
},
"browserslist": [
"defaults"
]
}
Loading

0 comments on commit 7daad79

Please sign in to comment.