Commit 95a12c1e authored by Michael Rose's avatar Michael Rose

frontend: half-ass conversion to webpack

Man, frontend webdev tech is gross.
parent 0c4f7f17
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": "> 1%",
"uglify": true
},
"useBuiltIns": true
}]
],
"plugins": [
"syntax-dynamic-import",
"transform-object-rest-spread",
["transform-class-properties", { "spec": true }]
]
}
......@@ -18,3 +18,8 @@
deploy.sh
.env
pids/
/public/packs
/public/packs-test
/node_modules
yarn-debug.log*
.yarn-integrity
plugins:
postcss-import: {}
postcss-cssnext: {}
......@@ -94,6 +94,8 @@ gem 'virtus'
# Rails5 removed some methods we needed.
gem 'record_tag_helper', '~> 1.0'
gem 'webpacker', '~> 3.5'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
......
......@@ -224,6 +224,8 @@ GEM
rack (>= 1.2.0)
rack-protection (2.0.0)
rack
rack-proxy (0.6.4)
rack
rack-test (0.7.0)
rack (>= 1.0, < 3)
rails (5.1.4)
......@@ -342,6 +344,10 @@ GEM
activemodel (>= 5.0)
bindex (>= 0.4.0)
railties (>= 5.0)
webpacker (3.5.5)
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
......@@ -404,6 +410,7 @@ DEPENDENCIES
unicorn
virtus
web-console
webpacker (~> 3.5)
BUNDLED WITH
1.14.6
This diff is collapsed.
......@@ -5,6 +5,7 @@
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= javascript_include_tag controller_name, media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_pack_tag 'application' %>
<%= csrf_meta_tags %>
<%= favicon_link_tag favicon_name %>
<meta name="viewport" content="width=device-width">
......
#!/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 "rubygems"
require "bundler/setup"
require "webpacker"
require "webpacker/webpack_runner"
Webpacker::WebpackRunner.run(ARGV)
#!/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 "rubygems"
require "bundler/setup"
require "webpacker"
require "webpacker/dev_server_runner"
Webpacker::DevServerRunner.run(ARGV)
Rails.application.configure do
# Verifies that versions and hashed value of the package contents in the project's package.json
config.webpacker.check_yarn_integrity = true
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
......
Rails.application.configure do
# Verifies that versions and hashed value of the package contents in the project's package.json
config.webpacker.check_yarn_integrity = false
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
......
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
const environment = require('./environment')
module.exports = environment.toWebpackConfig()
const { environment } = require('@rails/webpacker')
module.exports = environment
process.env.NODE_ENV = process.env.NODE_ENV || 'production'
const environment = require('./environment')
module.exports = environment.toWebpackConfig()
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
const environment = require('./environment')
module.exports = environment.toWebpackConfig()
# Note: You must restart bin/webpack-dev-server for changes to take effect
default: &default
source_path: app/javascript
source_entry_path: packs
public_output_path: packs
cache_path: tmp/cache/webpacker
# 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
extensions:
- .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
headers:
'Access-Control-Allow-Origin': '*'
watch_options:
ignored: /node_modules/
test:
<<: *default
compile: true
# 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
# Cache manifest.json for performance
cache_manifest: true
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"jquery": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz",
"integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg=="
}
}
}
{
"dependencies": {
"@rails/webpacker": "3.5",
"bootstrap3": "^3.3.5",
"chosen-jquery": "^0.1.1",
"chosen-js": "^1.8.3",
"coffee-loader": "^0.9.0",
"coffeescript": "^2.2.2",
"font-awesome": "^4.7.0",
"jquery": "^3.3.1",
"less": "^2.3.1",
"less-loader": "^4.0.6",
"popper.js": "^1.12.9",
"rails-erb-loader": "^5.3.0",
"rails-ujs": "^5.1.5",
"select2": "^4.0.6-rc.1",
"ts-loader": "^4.0.0",
"turbolinks": "^5.1.1",
"typescript": "^2.7.2"
},
"devDependencies": {
"webpack-dev-server": "2.11.2"
}
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment