webpacker 6.0.0.beta.6 → 6.0.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/jest.yml +1 -1
  3. data/.github/workflows/js-lint.yml +1 -1
  4. data/.github/workflows/ruby.yml +6 -9
  5. data/CHANGELOG.md +4 -20
  6. data/CONTRIBUTING.md +1 -1
  7. data/Gemfile.lock +5 -7
  8. data/README.md +109 -306
  9. data/docs/assets.md +135 -0
  10. data/docs/cloud9.md +310 -0
  11. data/docs/css.md +303 -0
  12. data/docs/deployment.md +148 -0
  13. data/docs/docker.md +68 -0
  14. data/docs/engines.md +213 -0
  15. data/docs/env.md +68 -0
  16. data/docs/es6.md +72 -0
  17. data/docs/folder-structure.md +66 -0
  18. data/docs/integrations.md +220 -0
  19. data/docs/misc.md +23 -0
  20. data/docs/props.md +187 -0
  21. data/docs/react.md +183 -0
  22. data/docs/target.md +22 -0
  23. data/docs/testing.md +147 -0
  24. data/docs/troubleshooting.md +3 -5
  25. data/docs/typescript.md +190 -0
  26. data/docs/v4-upgrade.md +142 -0
  27. data/docs/webpack-dev-server.md +94 -0
  28. data/docs/webpack.md +315 -0
  29. data/docs/yarn.md +23 -0
  30. data/lib/install/config/webpacker.yml +2 -4
  31. data/lib/install/examples/vue3/app.vue +27 -0
  32. data/lib/install/examples/vue3/hello_vue.js +15 -0
  33. data/lib/install/javascript/packs/application.css +9 -0
  34. data/lib/install/{packs/entrypoints → javascript/packs}/application.js +2 -4
  35. data/lib/install/template.rb +3 -3
  36. data/lib/webpacker/commands.rb +1 -2
  37. data/lib/webpacker/compiler.rb +3 -9
  38. data/lib/webpacker/dev_server_runner.rb +0 -2
  39. data/lib/webpacker/helper.rb +43 -13
  40. data/lib/webpacker/manifest.rb +1 -1
  41. data/lib/webpacker/version.rb +1 -1
  42. data/lib/webpacker/webpack_runner.rb +0 -1
  43. data/package.json +1 -1
  44. data/package/__tests__/development.js +1 -2
  45. data/package/babel/preset-react.js +62 -0
  46. data/package/babel/preset.js +13 -24
  47. data/package/environments/__tests__/base.js +5 -5
  48. data/package/environments/base.js +19 -19
  49. data/package/environments/development.js +0 -1
  50. data/package/environments/production.js +30 -28
  51. data/package/index.js +2 -7
  52. data/package/rules/babel.js +1 -1
  53. data/package/rules/coffee.js +5 -5
  54. data/package/rules/erb.js +3 -5
  55. data/package/rules/file.js +3 -5
  56. data/package/rules/index.js +17 -9
  57. data/package/rules/less.js +10 -14
  58. data/package/rules/sass.js +9 -13
  59. data/package/rules/svg.js +23 -0
  60. data/package/utils/get_style_rule.js +31 -27
  61. data/package/utils/helpers.js +0 -25
  62. data/test/configuration_test.rb +2 -2
  63. data/test/dev_server_runner_test.rb +2 -10
  64. data/test/helper_test.rb +39 -33
  65. data/test/manifest_test.rb +0 -8
  66. data/test/mounted_app/test/dummy/config/webpacker.yml +2 -2
  67. data/test/test_app/app/{packs/entrypoints → javascript/packs}/application.js +1 -1
  68. data/test/test_app/app/{packs/entrypoints → javascript/packs}/multi_entry.css +0 -0
  69. data/test/test_app/app/{packs/entrypoints → javascript/packs}/multi_entry.js +0 -0
  70. data/test/test_app/config/webpacker.yml +2 -2
  71. data/test/test_app/public/packs/manifest.json +0 -7
  72. metadata +36 -17
  73. data/6_0_upgrade.md +0 -62
  74. data/config/README.md +0 -3
  75. data/config/webpacker.yml +0 -1
  76. data/package/__tests__/index.js +0 -9
  77. data/package/rules/raw.js +0 -5
  78. data/package/rules/stylus.js +0 -26
data/docs/yarn.md ADDED
@@ -0,0 +1,23 @@
1
+ # Yarn
2
+
3
+ Webpacker by default uses `yarn` as a package manager for `node_modules`
4
+
5
+
6
+ ## Add a new npm module
7
+
8
+ To add any new JS module you can use `yarn`:
9
+
10
+ ```bash
11
+ yarn add bootstrap material-ui
12
+ ```
13
+
14
+ ## Add an npm module to `devDependencies`
15
+ To add a new JS module that will only be available to local development:
16
+
17
+ ```bash
18
+ yarn add --dev browser-sync
19
+ ```
20
+
21
+ Be careful not to add any build or app related JS modules in this fashion. Adding JS modules to `devDependencies` [will block them from being installed in **any** production environment](https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-production-true-false).
22
+
23
+ Docs from JS modules may instruct you to use `--dev` or `devDependencies`, but this is generally under the assumption that you are using a `node.js` workflow.
@@ -1,8 +1,8 @@
1
1
  # Note: You must restart bin/webpack-dev-server for changes to take effect
2
2
 
3
3
  default: &default
4
- source_path: app/packs
5
- source_entry_path: entrypoints
4
+ source_path: app/javascript
5
+ source_entry_path: packs
6
6
  public_root_path: public
7
7
  public_output_path: packs
8
8
  cache_path: tmp/cache/webpacker
@@ -25,8 +25,6 @@ development:
25
25
  host: localhost
26
26
  port: 3035
27
27
  public: localhost:3035
28
- # Inject browserside javascript that required by both HMR and Live(full) reload
29
- inject_client: true
30
28
  # Hot Module Replacement updates modules while the application is running without a full reload
31
29
  hmr: false
32
30
  # Inline should be set to true if using HMR; it inserts a script to take care of live reloading
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <p>
3
+ {{ message }}
4
+ </p>
5
+ </template>
6
+
7
+ <script>
8
+ import { ref } from 'vue'
9
+
10
+ export default {
11
+ name: 'HelloWorld',
12
+ setup() {
13
+ const message = ref('Hello World')
14
+
15
+ return {
16
+ message
17
+ }
18
+ }
19
+ }
20
+ </script>
21
+
22
+ <style scoped>
23
+ p {
24
+ font-size: 2em;
25
+ text-align: center;
26
+ }
27
+ </style>
@@ -0,0 +1,15 @@
1
+ /* eslint no-console: 0 */
2
+ // Run this example by adding <%= javascript_pack_tag 'hello_vue' %> (and
3
+ // <%= stylesheet_pack_tag 'hello_vue' %> if you have styles in your component)
4
+ // to the head of your layout file,
5
+ // like app/views/layouts/application.html.erb.
6
+ // Create a div container with the id 'vue-app' <div id='vue-app'></div>
7
+ // It renders <p>Hello Vue</p> into it.
8
+
9
+ import { createApp } from "vue";
10
+ import App from "../app.vue";
11
+
12
+ document.addEventListener("DOMContentLoaded", () => {
13
+ const app = createApp(App);
14
+ app.mount("#vue-app");
15
+ });
@@ -0,0 +1,9 @@
1
+ /*
2
+ Any CSS added to this file or imported from this file, e.g. `@import '../stylesheets/my-css.css'`,
3
+ will be included in the "application" pack. Any CSS imported from application.js or as part of the
4
+ application.js dependency graph, e.g. `import '../stylesheets/my-css.css'` will also be included
5
+ in the "application" pack.
6
+
7
+ To reference this file, add <%= stylesheet_pack_tag 'application' %> to the appropriate
8
+ layout file, like app/views/layouts/application.html.erb
9
+ */
@@ -1,12 +1,13 @@
1
1
  /* eslint no-console:0 */
2
2
  // This file is automatically compiled by Webpack, along with any other files
3
3
  // present in this directory. You're encouraged to place your actual application logic in
4
- // a relevant structure within app/packs and only use these pack files to reference
4
+ // a relevant structure within app/javascript and only use these pack files to reference
5
5
  // that code so it'll be compiled.
6
6
  //
7
7
  // To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
8
8
  // layout file, like app/views/layouts/application.html.erb
9
9
 
10
+
10
11
  // Uncomment to copy all static images under ../images to the output folder and reference
11
12
  // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
12
13
  // or the `imagePath` JavaScript helper below.
@@ -14,7 +15,4 @@
14
15
  // const images = require.context('../images', true)
15
16
  // const imagePath = (name) => images(name, true)
16
17
 
17
- import 'core-js/stable'
18
- import 'regenerator-runtime/runtime'
19
-
20
18
  console.log('Hello World from Webpacker')
@@ -5,10 +5,10 @@ say "Copying webpack core config"
5
5
  directory "#{__dir__}/config/webpack", "config/webpack"
6
6
 
7
7
  if Dir.exists?(Webpacker.config.source_path)
8
- say "The packs app source directory already exists"
8
+ say "The JavaScript app source directory already exists"
9
9
  else
10
- say "Creating packs app source directory"
11
- directory "#{__dir__}/packs", Webpacker.config.source_path
10
+ say "Creating JavaScript app source directory"
11
+ directory "#{__dir__}/javascript", Webpacker.config.source_path
12
12
  end
13
13
 
14
14
  apply "#{__dir__}/binstubs.rb"
@@ -64,8 +64,7 @@ class Webpacker::Commands
64
64
 
65
65
  def current_version
66
66
  packs = manifest.refresh.values.map do |value|
67
- value = value["src"] if value.is_a?(Hash)
68
- next unless value.is_a?(String)
67
+ next if value.is_a?(Hash)
69
68
 
70
69
  File.join(config.root_path, "public", "#{value}*")
71
70
  end.compact
@@ -28,14 +28,14 @@ class Webpacker::Compiler
28
28
  record_compilation_digest
29
29
  end
30
30
  else
31
- logger.debug "Everything's up-to-date. Nothing to do"
31
+ logger.info "Everything's up-to-date. Nothing to do"
32
32
  true
33
33
  end
34
34
  end
35
35
 
36
36
  # Returns true if all the compiled packs are up to date with the underlying asset files.
37
37
  def fresh?
38
- last_compilation_digest&.== watched_files_digest
38
+ watched_files_digest == last_compilation_digest
39
39
  end
40
40
 
41
41
  # Returns true if the compiled packs are out of date with the underlying asset files.
@@ -65,18 +65,12 @@ class Webpacker::Compiler
65
65
  compilation_digest_path.write(watched_files_digest)
66
66
  end
67
67
 
68
- def optionalRubyRunner
69
- bin_webpack_path = config.root_path.join("bin/webpack")
70
- first_line = File.readlines(bin_webpack_path).first.chomp
71
- /ruby/.match?(first_line) ? RbConfig.ruby : ""
72
- end
73
-
74
68
  def run_webpack
75
69
  logger.info "Compiling..."
76
70
 
77
71
  stdout, stderr, status = Open3.capture3(
78
72
  webpack_env,
79
- "#{optionalRubyRunner} ./bin/webpack",
73
+ "#{RbConfig.ruby} ./bin/webpack",
80
74
  chdir: File.expand_path(config.root_path)
81
75
  )
82
76
 
@@ -64,7 +64,6 @@ module Webpacker
64
64
  def execute_cmd
65
65
  env = Webpacker::Compiler.env
66
66
  env["WEBPACKER_CONFIG"] = @webpacker_config
67
- env["WEBPACK_DEV_SERVER"] = "true"
68
67
 
69
68
  cmd = if node_modules_bin_exist?
70
69
  ["#{@node_modules_bin_path}/webpack", "serve"]
@@ -74,7 +73,6 @@ module Webpacker
74
73
 
75
74
  if @argv.include?("--debug-webpacker")
76
75
  cmd = [ "node", "--inspect-brk"] + cmd
77
- @argv.delete "--debug-webpacker"
78
76
  end
79
77
 
80
78
  cmd += ["--config", @webpack_config]
@@ -72,15 +72,27 @@ module Webpacker::Helper
72
72
  favicon_link_tag(resolve_path_to_image(name), options)
73
73
  end
74
74
 
75
+ # Creates a script tag that references the named pack file, as compiled by webpack per the entries list
76
+ # in package/environments/base.js. By default, this list is auto-generated to match everything in
77
+ # app/javascript/packs/*.js. In production mode, the digested reference is automatically looked up.
78
+ #
79
+ # Example:
80
+ #
81
+ # <%= javascript_pack_tag 'calendar', 'data-turbolinks-track': 'reload' %> # =>
82
+ # <script src="/packs/calendar-1016838bab065ae1e314.js" data-turbolinks-track="reload"></script>
83
+ def javascript_pack_tag(*names, **options)
84
+ javascript_include_tag(*sources_from_manifest_entries(names, type: :javascript), **options)
85
+ end
86
+
75
87
  # Creates script tags that reference the js chunks from entrypoints when using split chunks API,
76
88
  # as compiled by webpack per the entries list in package/environments/base.js.
77
89
  # By default, this list is auto-generated to match everything in
78
- # app/packs/entrypoints/*.js and all the dependent chunks. In production mode, the digested reference is automatically looked up.
90
+ # app/javascript/packs/*.js and all the dependent chunks. In production mode, the digested reference is automatically looked up.
79
91
  # See: https://webpack.js.org/plugins/split-chunks-plugin/
80
92
  #
81
93
  # Example:
82
94
  #
83
- # <%= javascript_pack_tag 'calendar', 'map', 'data-turbolinks-track': 'reload' %> # =>
95
+ # <%= javascript_packs_with_chunks_tag 'calendar', 'map', 'data-turbolinks-track': 'reload' %> # =>
84
96
  # <script src="/packs/vendor-16838bab065ae1e314.chunk.js" data-turbolinks-track="reload"></script>
85
97
  # <script src="/packs/calendar~runtime-16838bab065ae1e314.chunk.js" data-turbolinks-track="reload"></script>
86
98
  # <script src="/packs/calendar-1016838bab065ae1e314.chunk.js" data-turbolinks-track="reload"></script>
@@ -89,13 +101,13 @@ module Webpacker::Helper
89
101
  #
90
102
  # DO:
91
103
  #
92
- # <%= javascript_pack_tag 'calendar', 'map' %>
104
+ # <%= javascript_packs_with_chunks_tag 'calendar', 'map' %>
93
105
  #
94
106
  # DON'T:
95
107
  #
96
- # <%= javascript_pack_tag 'calendar' %>
97
- # <%= javascript_pack_tag 'map' %>
98
- def javascript_pack_tag(*names, **options)
108
+ # <%= javascript_packs_with_chunks_tag 'calendar' %>
109
+ # <%= javascript_packs_with_chunks_tag 'map' %>
110
+ def javascript_packs_with_chunks_tag(*names, **options)
99
111
  javascript_include_tag(*sources_from_manifest_entrypoints(names, type: :javascript), **options)
100
112
  end
101
113
 
@@ -115,35 +127,53 @@ module Webpacker::Helper
115
127
  end
116
128
  end
117
129
 
130
+ # Creates a link tag that references the named pack file, as compiled by webpack per the entries list
131
+ # in package/environments/base.js. By default, this list is auto-generated to match everything in
132
+ # app/javascript/packs/*.js. In production mode, the digested reference is automatically looked up.
133
+ #
134
+ # Note: If the development server is running and hot module replacement is active, this will return nothing.
135
+ # In that setup you need to configure your styles to be inlined in your JavaScript for hot reloading.
136
+ #
137
+ # Examples:
138
+ #
139
+ # <%= stylesheet_pack_tag 'calendar', 'data-turbolinks-track': 'reload' %> # =>
140
+ # <link rel="stylesheet" media="screen" href="/packs/calendar-1016838bab065ae1e122.css" data-turbolinks-track="reload" />
141
+ def stylesheet_pack_tag(*names, **options)
142
+ stylesheet_link_tag(*sources_from_manifest_entries(names, type: :stylesheet), **options)
143
+ end
144
+
118
145
  # Creates link tags that reference the css chunks from entrypoints when using split chunks API,
119
146
  # as compiled by webpack per the entries list in package/environments/base.js.
120
147
  # By default, this list is auto-generated to match everything in
121
- # app/packs/entrypoints/*.js and all the dependent chunks. In production mode, the digested reference is automatically looked up.
148
+ # app/javascript/packs/*.js and all the dependent chunks. In production mode, the digested reference is automatically looked up.
122
149
  # See: https://webpack.js.org/plugins/split-chunks-plugin/
123
150
  #
124
151
  # Examples:
125
152
  #
126
- # <%= stylesheet_pack_tag 'calendar', 'map' %> # =>
153
+ # <%= stylesheet_packs_with_chunks_tag 'calendar', 'map' %> # =>
127
154
  # <link rel="stylesheet" media="screen" href="/packs/3-8c7ce31a.chunk.css" />
128
155
  # <link rel="stylesheet" media="screen" href="/packs/calendar-8c7ce31a.chunk.css" />
129
156
  # <link rel="stylesheet" media="screen" href="/packs/map-8c7ce31a.chunk.css" />
130
157
  #
131
158
  # DO:
132
159
  #
133
- # <%= stylesheet_pack_tag 'calendar', 'map' %>
160
+ # <%= stylesheet_packs_with_chunks_tag 'calendar', 'map' %>
134
161
  #
135
162
  # DON'T:
136
163
  #
137
- # <%= stylesheet_pack_tag 'calendar' %>
138
- # <%= stylesheet_pack_tag 'map' %>
139
- def stylesheet_pack_tag(*names, **options)
164
+ # <%= stylesheet_packs_with_chunks_tag 'calendar' %>
165
+ # <%= stylesheet_packs_with_chunks_tag 'map' %>
166
+ def stylesheet_packs_with_chunks_tag(*names, **options)
140
167
  stylesheet_link_tag(*sources_from_manifest_entrypoints(names, type: :stylesheet), **options)
141
168
  end
142
169
 
143
170
  private
171
+ def sources_from_manifest_entries(names, type:)
172
+ names.map { |name| current_webpacker_instance.manifest.lookup!(name, type: type) }.flatten
173
+ end
144
174
 
145
175
  def sources_from_manifest_entrypoints(names, type:)
146
- names.map { |name| current_webpacker_instance.manifest.lookup_pack_with_chunks!(name.to_s, type: type) }.flatten.uniq
176
+ names.map { |name| current_webpacker_instance.manifest.lookup_pack_with_chunks!(name, type: type) }.flatten.uniq
147
177
  end
148
178
 
149
179
  def resolve_path_to_image(name, **options)
@@ -92,7 +92,7 @@ class Webpacker::Manifest
92
92
  # When the user provides a name with a file extension, we want to try to strip it off.
93
93
  def manifest_name(name, pack_type)
94
94
  return name if File.extname(name.to_s).empty?
95
- File.basename(name, ".#{pack_type}")
95
+ File.basename(name, pack_type)
96
96
  end
97
97
 
98
98
  def manifest_type(pack_type)
@@ -1,4 +1,4 @@
1
1
  module Webpacker
2
2
  # Change the version in package.json too, please!
3
- VERSION = "6.0.0.beta.6".freeze
3
+ VERSION = "6.0.0.pre.1".freeze
4
4
  end
@@ -15,7 +15,6 @@ module Webpacker
15
15
 
16
16
  if @argv.include?("--debug-webpacker")
17
17
  cmd = [ "node", "--inspect-brk"] + cmd
18
- @argv.delete "--debug-webpacker"
19
18
  end
20
19
 
21
20
  if @argv.include?("--trace-deprecation")
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rails/webpacker",
3
- "version": "6.0.0-beta.6",
3
+ "version": "6.0.0-pre.1",
4
4
  "description": "Use webpack to manage app-like JavaScript modules in Rails",
5
5
  "main": "package/index.js",
6
6
  "files": [
@@ -22,8 +22,7 @@ describe('Development environment', () => {
22
22
  expect(webpackConfig).toMatchObject({
23
23
  devServer: {
24
24
  host: 'localhost',
25
- port: 3035,
26
- injectClient: true
25
+ port: 3035
27
26
  }
28
27
  })
29
28
  })
@@ -0,0 +1,62 @@
1
+ module.exports = function config(api) {
2
+ const validEnv = ['development', 'test', 'production']
3
+ const currentEnv = api.env()
4
+ const isDevelopmentEnv = api.env('development')
5
+ const isProductionEnv = api.env('production')
6
+ const isTestEnv = api.env('test')
7
+
8
+ if (!validEnv.includes(currentEnv)) {
9
+ throw new Error(
10
+ `Please specify a valid NODE_ENV or BABEL_ENV environment variable. Valid values are "development", "test", and "production". Instead, received: "${JSON.stringify(currentEnv)}".`
11
+ )
12
+ }
13
+
14
+ return {
15
+ presets: [
16
+ isTestEnv && [
17
+ '@babel/preset-env',
18
+ {
19
+ targets: { node: 'current' },
20
+ modules: 'commonjs'
21
+ }
22
+ ],
23
+ (isProductionEnv || isDevelopmentEnv) && [
24
+ '@babel/preset-env',
25
+ {
26
+ useBuiltIns: 'entry',
27
+ corejs: '3.8',
28
+ modules: false,
29
+ bugfixes: true,
30
+ loose: true,
31
+ exclude: ['transform-typeof-symbol']
32
+ }
33
+ ],
34
+ [
35
+ '@babel/preset-react',
36
+ {
37
+ development: isDevelopmentEnv || isTestEnv,
38
+ useBuiltIns: true
39
+ }
40
+ ]
41
+ ].filter(Boolean),
42
+ plugins: [
43
+ 'babel-plugin-macros',
44
+ [
45
+ '@babel/plugin-proposal-class-properties',
46
+ { loose: true }
47
+ ],
48
+ [
49
+ '@babel/plugin-transform-runtime',
50
+ {
51
+ helpers: false,
52
+ regenerator: true,
53
+ corejs: false
54
+ }
55
+ ],
56
+ isProductionEnv && [
57
+ 'babel-plugin-transform-react-remove-prop-types',
58
+ { removeImport: true }
59
+ ]
60
+ ].filter(Boolean)
61
+ }
62
+ }
@@ -1,5 +1,3 @@
1
- const { moduleExists } = require('@rails/webpacker')
2
-
3
1
  module.exports = function config(api) {
4
2
  const validEnv = ['development', 'test', 'production']
5
3
  const currentEnv = api.env()
@@ -9,15 +7,16 @@ module.exports = function config(api) {
9
7
 
10
8
  if (!validEnv.includes(currentEnv)) {
11
9
  throw new Error(
12
- `Please specify a valid NODE_ENV or BABEL_ENV environment variable. Valid values are "development", "test", and "production". Instead, received: "${JSON.stringify(
13
- currentEnv
14
- )}".`
10
+ `Please specify a valid NODE_ENV or BABEL_ENV environment variable. Valid values are "development", "test", and "production". Instead, received: "${JSON.stringify(currentEnv)}".`
15
11
  )
16
12
  }
17
13
 
18
14
  return {
19
15
  presets: [
20
- isTestEnv && ['@babel/preset-env', { targets: { node: 'current' } }],
16
+ isTestEnv && [
17
+ '@babel/preset-env',
18
+ { targets: { node: 'current' } }
19
+ ],
21
20
  (isProductionEnv || isDevelopmentEnv) && [
22
21
  '@babel/preset-env',
23
22
  {
@@ -28,28 +27,18 @@ module.exports = function config(api) {
28
27
  loose: true,
29
28
  exclude: ['transform-typeof-symbol']
30
29
  }
31
- ],
32
- moduleExists('@babel/preset-typescript') && [
33
- '@babel/preset-typescript',
34
- { allExtensions: true, isTSX: true }
35
- ],
36
- moduleExists('@babel/preset-react') && [
37
- '@babel/preset-react',
38
- {
39
- development: isDevelopmentEnv || isTestEnv,
40
- useBuiltIns: true
41
- }
42
30
  ]
43
31
  ].filter(Boolean),
44
32
  plugins: [
45
33
  'babel-plugin-macros',
46
- ['@babel/plugin-proposal-class-properties', { loose: true }],
47
- ['@babel/plugin-transform-runtime', { helpers: false }],
48
- isProductionEnv &&
49
- moduleExists('babel-plugin-transform-react-remove-prop-types') && [
50
- 'babel-plugin-transform-react-remove-prop-types',
51
- { removeImport: true }
52
- ]
34
+ [
35
+ '@babel/plugin-proposal-class-properties',
36
+ { loose: true }
37
+ ],
38
+ [
39
+ '@babel/plugin-transform-runtime',
40
+ { helpers: false }
41
+ ]
53
42
  ].filter(Boolean)
54
43
  }
55
44
  }