Skip to content

Commit

Permalink
Manually upgrade v5 to v6
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Guo committed Jan 11, 2022
1 parent cc16d24 commit ea2bf82
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 66 deletions.
1 change: 0 additions & 1 deletion .browserslistrc

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions config/webpack/base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { webpackConfig, merge } = require('@rails/webpacker')
const customConfig = {
resolve: {
extensions: ['.css']
}
}

module.exports = merge(webpackConfig, customConfig)
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
3 changes: 0 additions & 3 deletions config/webpack/environment.js

This file was deleted.

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
79 changes: 24 additions & 55 deletions config/webpacker.yml
Original file line number Diff line number Diff line change
@@ -1,79 +1,51 @@
# Note: You must restart bin/webpack-dev-server for changes to take effect

---
default: &default
source_path: app/javascript
source_entry_path: packs
source_path: app/packs
source_entry_path: entrypoints
public_root_path: public
public_output_path: packs
cache_path: tmp/cache/webpacker
check_yarn_integrity: false
webpack_compile_output: false
cache_path: tmp/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: ['app/assets']

# Reload manifest.json on all requests so we reload latest compiled packs
cache_manifest: false

# Extract and emit a css file
extract_css: true

static_assets_extensions:
- .jpg
- .jpeg
- .png
- .gif
- .tiff
- .ico
- .svg
- .eot
- .otf
- .ttf
- .woff
- .woff2

extensions:
- .mjs
- .js
- .sass
- .scss
- .css
- .module.sass
- .module.scss
- .module.css
- .png
- .svg
- .gif
- .jpeg
- .jpg

development:
<<: *default
compile: true

# Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules
check_yarn_integrity: true

# Reference: https://webpack.js.org/configuration/dev-server/
dev_server:
https: false
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: true
headers:
'Access-Control-Allow-Origin': '*'
watch_options:
ignored: '**/node_modules/**'

static:
watch:
ignored: '**/node_modules/**'

test:
<<: *default
Expand All @@ -88,8 +60,5 @@ production:
# Production depends on precompilation of packs prior to booting for performance.
compile: false

# Extract and emit a css file
extract_css: true

# Cache manifest.json for performance
cache_manifest: true
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@
"presets": [
"./node_modules/@rails/webpacker/package/babel/preset.js"
]
}
},
"browserslist": [
"defaults"
]
}

0 comments on commit ea2bf82

Please sign in to comment.