Remove Webpacker

This commit is contained in:
Andreas Nedbal 2023-01-06 08:55:50 +01:00 committed by Andreas Nedbal
parent e80bc24be0
commit 8b5271df69
15 changed files with 35 additions and 6706 deletions

2
.gitignore vendored
View File

@ -14,8 +14,6 @@
/app/assets/builds/* /app/assets/builds/*
!/app/assets/builds/.keep !/app/assets/builds/.keep
/public/assets /public/assets
/public/packs
/public/packs-test
# RSpec example status persistence, used by e.g. `rspec --only-failures` # RSpec example status persistence, used by e.g. `rspec --only-failures`
/spec/examples.txt /spec/examples.txt

View File

@ -109,8 +109,6 @@ group :production do
gem "lograge" gem "lograge"
end end
gem "webpacker", "~> 5.2"
gem "omniauth-rails_csrf_protection", "~> 1.0" gem "omniauth-rails_csrf_protection", "~> 1.0"
gem "net-imap" gem "net-imap"

View File

@ -326,8 +326,6 @@ GEM
rack (2.2.5) rack (2.2.5)
rack-protection (2.2.2) rack-protection (2.2.2)
rack rack
rack-proxy (0.7.2)
rack
rack-test (2.0.2) rack-test (2.0.2)
rack (>= 1.3) rack (>= 1.3)
rails (6.1.7) rails (6.1.7)
@ -450,7 +448,6 @@ GEM
sprockets (> 3.0) sprockets (> 3.0)
sprockets-rails sprockets-rails
tilt tilt
semantic_range (3.0.0)
sentry-rails (5.7.0) sentry-rails (5.7.0)
railties (>= 5.0) railties (>= 5.0)
sentry-ruby (~> 5.7.0) sentry-ruby (~> 5.7.0)
@ -523,11 +520,6 @@ GEM
uniform_notifier (1.16.0) uniform_notifier (1.16.0)
warden (1.2.9) warden (1.2.9)
rack (>= 2.0.9) rack (>= 2.0.9)
webpacker (5.4.3)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
webpush (1.1.0) webpush (1.1.0)
hkdf (~> 0.2) hkdf (~> 0.2)
jwt (~> 2.0) jwt (~> 2.0)
@ -623,7 +615,6 @@ DEPENDENCIES
turbo-rails turbo-rails
twitter twitter
twitter-text twitter-text
webpacker (~> 5.2)
BUNDLED WITH BUNDLED WITH
2.3.18 2.3.18

View File

@ -1,83 +0,0 @@
module.exports = function(api) {
var validEnv = ['development', 'test', 'production']
var currentEnv = api.env()
var isDevelopmentEnv = api.env('development')
var isProductionEnv = api.env('production')
var isTestEnv = api.env('test')
if (!validEnv.includes(currentEnv)) {
throw new Error(
'Please specify a valid `NODE_ENV` or ' +
'`BABEL_ENV` environment variables. Valid values are "development", ' +
'"test", and "production". Instead, received: ' +
JSON.stringify(currentEnv) +
'.'
)
}
return {
presets: [
isTestEnv && [
'@babel/preset-env',
{
targets: {
node: 'current'
}
}
],
(isProductionEnv || isDevelopmentEnv) && [
'@babel/preset-env',
{
forceAllTransforms: true,
useBuiltIns: 'entry',
corejs: 3,
modules: false,
exclude: ['transform-typeof-symbol']
}
],
].filter(Boolean),
plugins: [
'babel-plugin-macros',
'@babel/plugin-syntax-dynamic-import',
isTestEnv && 'babel-plugin-dynamic-import-node',
["@babel/plugin-transform-typescript", { 'allExtensions': true, 'isTSX': true, 'allowDeclareFields': true }],
'@babel/plugin-transform-destructuring',
[
'@babel/plugin-proposal-class-properties',
{
loose: true
}
],
[
'@babel/plugin-proposal-private-methods',
{
loose: true
}
],
[
'@babel/plugin-proposal-private-property-in-object',
{
loose: true
}
],
[
'@babel/plugin-proposal-object-rest-spread',
{
useBuiltIns: true
}
],
[
'@babel/plugin-transform-runtime',
{
helpers: false
}
],
[
'@babel/plugin-transform-regenerator',
{
async: false
}
]
].filter(Boolean)
}
}

View File

@ -1,18 +0,0 @@
#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= "development"
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require "bundler/setup"
require "webpacker"
require "webpacker/webpack_runner"
APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
Webpacker::WebpackRunner.run(ARGV)
end

View File

@ -1,18 +0,0 @@
#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= "development"
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require "bundler/setup"
require "webpacker"
require "webpacker/dev_server_runner"
APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
Webpacker::DevServerRunner.run(ARGV)
end

View File

@ -1,6 +1,6 @@
Rails.application.configure do Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb. # Settings specified here will take precedence over those in config/application.rb.
config.asset_source = :webpacker config.asset_source = :sprockets
# Code is not reloaded between requests. # Code is not reloaded between requests.
config.cache_classes = true config.cache_classes = true

View File

@ -1,5 +0,0 @@
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
const environment = require('./environment')
module.exports = environment.toWebpackConfig()

View File

@ -1,13 +0,0 @@
const path = require('path')
const { environment } = require('@rails/webpacker')
environment.config.merge({
resolve: {
alias: {
retrospring: path.resolve(__dirname, '..', '..', 'app/javascript/retrospring'),
utilities: path.resolve(__dirname, '..', '..', 'app/javascript/retrospring/utilities')
}
}
})
module.exports = environment

View File

@ -1,5 +0,0 @@
process.env.NODE_ENV = process.env.NODE_ENV || 'production'
const environment = require('./environment')
module.exports = environment.toWebpackConfig()

View File

@ -1,5 +0,0 @@
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
const environment = require('./environment')
module.exports = environment.toWebpackConfig()

View File

@ -1,95 +0,0 @@
# Note: You must restart bin/webpack-dev-server for changes to take effect
default: &default
source_path: app/javascript
source_entry_path: packs
public_root_path: public
public_output_path: packs
cache_path: tmp/cache/webpacker
webpack_compile_output: true
# Additional paths webpack should lookup modules
# ['app/assets', 'engine/foo/app/assets']
resolved_paths: []
# Reload manifest.json on all requests so we reload latest compiled packs
cache_manifest: false
# Extract and emit a css file
extract_css: false
static_assets_extensions:
- .jpg
- .jpeg
- .png
- .gif
- .tiff
- .ico
- .svg
- .eot
- .otf
- .ttf
- .woff
- .woff2
extensions:
- .tsx
- .ts
- .coffee
- .mjs
- .js
- .sass
- .scss
- .css
- .module.sass
- .module.scss
- .module.css
- .png
- .svg
- .gif
- .jpeg
- .jpg
development:
<<: *default
compile: true
# Reference: https://webpack.js.org/configuration/dev-server/
dev_server:
https: false
host: localhost
port: 3035
public: localhost:3035
hmr: false
# Inline should be set to true if using HMR
inline: true
overlay: true
compress: true
disable_host_check: true
use_local_ip: false
quiet: false
pretty: false
headers:
'Access-Control-Allow-Origin': '*'
watch_options:
ignored: '**/node_modules/**'
test:
<<: *default
compile: false
# Compile test packs to a separate directory
public_output_path: packs-test
production:
<<: *default
# 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

View File

@ -6,37 +6,28 @@
"build:css": "sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules" "build:css": "sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules"
}, },
"dependencies": { "dependencies": {
"@babel/preset-typescript": "^7.18.6",
"@fontsource/lexend": "^4.5.13", "@fontsource/lexend": "^4.5.13",
"@fortawesome/fontawesome-free": "^6.2.1", "@fortawesome/fontawesome-free": "^6.2.1",
"@hotwired/stimulus": "^3.2.1", "@hotwired/stimulus": "^3.2.1",
"@hotwired/stimulus-webpack-helpers": "^1.0.1",
"@hotwired/turbo-rails": "^7.2.4", "@hotwired/turbo-rails": "^7.2.4",
"@melloware/coloris": "^0.16.1", "@melloware/coloris": "^0.16.1",
"@popperjs/core": "^2.11", "@popperjs/core": "^2.11",
"@rails/request.js": "^0.0.8", "@rails/request.js": "^0.0.8",
"bootstrap": "^5.2", "bootstrap": "^5.2",
"cheet.js": "^0.3.3", "cheet.js": "^0.3.3",
"core-js": "^3.27.1",
"croppr": "^2.3.1", "croppr": "^2.3.1",
"esbuild": "^0.16.14",
"i18n-js": "^4.0", "i18n-js": "^4.0",
"js-cookie": "2.2.1", "js-cookie": "2.2.1",
"regenerator-runtime": "^0.13.11",
"sass": "^1.57.1", "sass": "^1.57.1",
"sweetalert": "1.1.3", "sweetalert": "1.1.3",
"toastify-js": "^1.12.0", "toastify-js": "^1.12.0",
"typescript": "^4.9.4" "typescript": "^4.9.4"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.20.7",
"@babel/preset-env": "^7.20.2",
"@rails/webpacker": "5.4.3",
"@typescript-eslint/eslint-plugin": "^4.11.0", "@typescript-eslint/eslint-plugin": "^4.11.0",
"@typescript-eslint/parser": "^4.11.0", "@typescript-eslint/parser": "^4.11.0",
"esbuild": "^0.16.14",
"eslint": "^7.16.0", "eslint": "^7.16.0",
"eslint-plugin-import": "^2.26.0", "eslint-plugin-import": "^2.26.0"
"webpack": "^4",
"webpack-dev-server": "^4.11.1"
} }
} }

View File

@ -1,12 +0,0 @@
module.exports = {
plugins: [
require('postcss-import'),
require('postcss-flexbugs-fixes'),
require('postcss-preset-env')({
autoprefixer: {
flexbox: 'no-2009'
},
stage: 3
})
]
}

6459
yarn.lock

File diff suppressed because it is too large Load Diff