Skip to content

Commit 19ef4fb

Browse files
committed
first step
1 parent 566e158 commit 19ef4fb

16 files changed

+1529
-1967
lines changed
File renamed without changes.

.browserslistrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
defaults

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,10 @@ vendor_4.2.4/
6060
*.swp
6161
*.swo
6262

63+
64+
/public/packs
65+
/public/packs-test
66+
/node_modules
67+
/yarn-error.log
68+
yarn-debug.log*
69+
.yarn-integrity

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ source 'https://rubygems.org'
1212
gem 'unf', '>= 0.2.0beta2'
1313

1414
gem 'rails', '~> 5.2.5' # Don't use 5.1.3 because of redirect errors in tests (scriptr vs. script name in ActionPack)
15-
gem 'webpacker', '~> 4.0' # Check package.json -> "@rails/webpacker"
15+
gem 'webpacker', '~> 5.0' # Check package.json -> "@rails/webpacker"
1616

1717
# Views and Assets
1818
gem 'compass-rails'

Gemfile.lock

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ GEM
533533
ffi (~> 1.9)
534534
sdoc (1.1.0)
535535
rdoc (>= 5.0)
536+
semantic_range (3.0.0)
536537
sentry-raven (2.6.3)
537538
faraday (>= 0.7.6, < 1.0)
538539
sexp_processor (4.10.0)
@@ -574,10 +575,11 @@ GEM
574575
activemodel (>= 5.0)
575576
bindex (>= 0.4.0)
576577
railties (>= 5.0)
577-
webpacker (4.3.0)
578-
activesupport (>= 4.2)
578+
webpacker (5.4.3)
579+
activesupport (>= 5.2)
579580
rack-proxy (>= 0.6.1)
580-
railties (>= 4.2)
581+
railties (>= 5.2)
582+
semantic_range (>= 2.3.0)
581583
websocket-driver (0.7.2)
582584
websocket-extensions (>= 0.1.0)
583585
websocket-extensions (0.1.5)
@@ -670,7 +672,7 @@ DEPENDENCIES
670672
unf (>= 0.2.0beta2)
671673
web-console (~> 3.0)
672674
webconsole!
673-
webpacker (~> 4.0)
675+
webpacker (~> 5.0)
674676

675677
BUNDLED WITH
676678
1.17.3

babel.config.js

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
module.exports = function(api) {
2+
var validEnv = ['development', 'test', 'production']
3+
var currentEnv = api.env()
4+
var isDevelopmentEnv = api.env('development')
5+
var isProductionEnv = api.env('production')
6+
var isTestEnv = api.env('test')
7+
8+
if (!validEnv.includes(currentEnv)) {
9+
throw new Error(
10+
'Please specify a valid `NODE_ENV` or ' +
11+
'`BABEL_ENV` environment variables. Valid values are "development", ' +
12+
'"test", and "production". Instead, received: ' +
13+
JSON.stringify(currentEnv) +
14+
'.'
15+
)
16+
}
17+
18+
return {
19+
presets: [
20+
isTestEnv && [
21+
'@babel/preset-env',
22+
{
23+
targets: {
24+
node: 'current'
25+
}
26+
}
27+
],
28+
(isProductionEnv || isDevelopmentEnv) && [
29+
'@babel/preset-env',
30+
{
31+
forceAllTransforms: true,
32+
useBuiltIns: 'entry',
33+
corejs: 3,
34+
modules: false,
35+
exclude: ['transform-typeof-symbol']
36+
}
37+
],
38+
"@babel/preset-react"
39+
].filter(Boolean),
40+
plugins: [
41+
"react-require",
42+
'babel-plugin-macros',
43+
'@babel/plugin-syntax-dynamic-import',
44+
isTestEnv && 'babel-plugin-dynamic-import-node',
45+
'@babel/plugin-transform-destructuring',
46+
[
47+
'@babel/plugin-proposal-class-properties',
48+
{
49+
loose: true
50+
}
51+
],
52+
[
53+
'@babel/plugin-proposal-object-rest-spread',
54+
{
55+
useBuiltIns: true
56+
}
57+
],
58+
[
59+
'@babel/plugin-proposal-private-methods',
60+
{
61+
loose: true
62+
}
63+
],
64+
[
65+
'@babel/plugin-proposal-private-property-in-object',
66+
{
67+
loose: true
68+
}
69+
],
70+
[
71+
'@babel/plugin-transform-runtime',
72+
{
73+
helpers: false
74+
}
75+
],
76+
[
77+
'@babel/plugin-transform-regenerator',
78+
{
79+
async: false
80+
}
81+
]
82+
].filter(Boolean)
83+
}
84+
}

bin/webpack

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ require "pathname"
77
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
88
Pathname.new(__FILE__).realpath)
99

10-
require "rubygems"
1110
require "bundler/setup"
1211

1312
require "webpacker"
1413
require "webpacker/webpack_runner"
15-
Webpacker::WebpackRunner.run(ARGV)
14+
15+
APP_ROOT = File.expand_path("..", __dir__)
16+
Dir.chdir(APP_ROOT) do
17+
Webpacker::WebpackRunner.run(ARGV)
18+
end

bin/webpack-dev-server

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ require "pathname"
77
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
88
Pathname.new(__FILE__).realpath)
99

10-
require "rubygems"
1110
require "bundler/setup"
1211

1312
require "webpacker"
1413
require "webpacker/dev_server_runner"
15-
Webpacker::DevServerRunner.run(ARGV)
14+
15+
APP_ROOT = File.expand_path("..", __dir__)
16+
Dir.chdir(APP_ROOT) do
17+
Webpacker::DevServerRunner.run(ARGV)
18+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?

config/webpack/development.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
2+
13
const environment = require('./environment')
24
const extendConfig = require('./custom')
35

4-
module.exports = extendConfig(environment)
6+
module.exports = extendConfig(environment)
7+

0 commit comments

Comments
 (0)