File tree 2 files changed +27
-0
lines changed 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ const sizes = require('./plugins/sizes-plugin');
20
20
const useForks = require ( './plugins/use-forks-plugin' ) ;
21
21
const stripUnusedImports = require ( './plugins/strip-unused-imports' ) ;
22
22
const dynamicImports = require ( './plugins/dynamic-imports' ) ;
23
+ const disableDomPropertyTreeshake = require ( './plugins/disable-domproperty-treeshake' ) ;
23
24
const Packaging = require ( './packaging' ) ;
24
25
const { asyncRimRaf} = require ( './utils' ) ;
25
26
const codeFrame = require ( '@babel/code-frame' ) ;
@@ -333,6 +334,7 @@ function getPlugins(
333
334
bundleType === RN_FB_PROFILING ;
334
335
const shouldStayReadable = isFBWWWBundle || isRNBundle || forcePrettyOutput ;
335
336
return [
337
+ disableDomPropertyTreeshake ( ) ,
336
338
// Keep dynamic imports as externals
337
339
dynamicImports ( ) ,
338
340
{
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ 'use strict' ;
8
+
9
+ module . exports = function disableTreeshake ( ) {
10
+ return {
11
+ name : 'scripts/rollup/plugins/disable-treeshake' ,
12
+ transform ( code , id ) {
13
+ // Fix issue with `react-dom-webpack-server` bundles accidentally
14
+ // stripping out the `properties` object and not filling it out
15
+ if ( id . endsWith ( 'DOMProperty.js' ) ) {
16
+ return {
17
+ code,
18
+ map : null ,
19
+ moduleSideEffects : 'no-treeshake' ,
20
+ } ;
21
+ }
22
+ return null ;
23
+ } ,
24
+ } ;
25
+ } ;
You can’t perform that action at this time.
0 commit comments