Skip to content

Commit 38b7386

Browse files
authored
[Bsb] Revert the React template from es6 to commonjs (#2617)
* [Bsb] Revert the React template from es6 to commonjs See #2587 (comment) * Update README.md
1 parent 03b944d commit 38b7386

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

jscomp/bsb/templates/react/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ npm run webpack:production
2020
```
2121

2222
This will replace the development artifact `build/Index.js` for an optimized version.
23+
24+
**To enable dead code elimination**, change `bsconfig.json`'s `package-specs` `module` from `"commonjs"` to `"es6"`. Then re-run the above 2 commands. This will allow Webpack to remove unused code.

jscomp/bsb/templates/react/bsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"subdirs" : true
1313
},
1414
"package-specs": [{
15-
"module": "es6",
15+
"module": "commonjs",
1616
"in-source": true
1717
}],
1818
"suffix": ".bs.js",

0 commit comments

Comments
 (0)