Skip to content

Commit 62bf728

Browse files
authored
fix: Set a conservative output.environment on Webpack bundles (#330)
1 parent aa9eb3b commit 62bf728

File tree

5 files changed

+38
-89
lines changed

5 files changed

+38
-89
lines changed

packages/fuselage-ui-kit/webpack.config.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,20 @@ module.exports = (env, { mode = 'production' }) => ({
1212
'fuselage-ui-kit': path.resolve(__dirname, 'src/index.js'),
1313
},
1414
output: {
15-
filename: `[name].${ mode }.js`,
15+
filename: `[name].${mode}.js`,
1616
path: path.resolve(__dirname, 'dist'),
1717
library: 'RocketChatFuselageUiKit',
1818
libraryTarget: 'umd',
1919
umdNamedDefine: true,
20+
environment: {
21+
arrowFunction: false,
22+
bigIntLiteral: false,
23+
const: false,
24+
destructuring: false,
25+
dynamicImport: false,
26+
forOf: false,
27+
module: false,
28+
},
2029
},
2130
devtool: mode === 'production' ? false : 'source-map',
2231
module: {
@@ -28,11 +37,7 @@ module.exports = (env, { mode = 'production' }) => ({
2837
},
2938
],
3039
},
31-
externals: [
32-
'react',
33-
'react-dom',
34-
/^@rocket.chat\//,
35-
],
40+
externals: ['react', 'react-dom', /^@rocket.chat\//],
3641
plugins: [
3742
new webpack.DefinePlugin({
3843
'process.env.VERSION': JSON.stringify(pkg.version),

packages/fuselage/webpack.config.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,20 @@ module.exports = (env, { mode = 'production' }) => ({
99
fuselage: path.resolve(__dirname, 'src/index.js'),
1010
},
1111
output: {
12-
filename: `[name].${ mode }.js`,
12+
filename: `[name].${mode}.js`,
1313
path: path.resolve(__dirname, 'dist'),
1414
library: 'RocketChatFuselage',
1515
libraryTarget: 'umd',
1616
umdNamedDefine: true,
17+
environment: {
18+
arrowFunction: false,
19+
bigIntLiteral: false,
20+
const: false,
21+
destructuring: false,
22+
dynamicImport: false,
23+
forOf: false,
24+
module: false,
25+
},
1726
},
1827
devtool: mode === 'production' ? false : 'source-map',
1928
module: {

packages/ui-kit/.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/node_modules
22
/dist
33
!/.eslintrc.js
4+
/webpack.config.js

packages/ui-kit/webpack.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ module.exports = (env, argv) => ({
1616
library: 'RocketChatUiKit',
1717
libraryTarget: 'umd',
1818
umdNamedDefine: true,
19+
environment: {
20+
arrowFunction: false,
21+
bigIntLiteral: false,
22+
const: false,
23+
destructuring: false,
24+
dynamicImport: false,
25+
forOf: false,
26+
module: false,
27+
},
1928
},
2029
resolve: {
2130
extensions: ['.ts', '.tsx', '.js'],

yarn.lock

+7-82
Original file line numberDiff line numberDiff line change
@@ -1426,38 +1426,6 @@
14261426
minimatch "^3.0.4"
14271427
strip-json-comments "^3.1.1"
14281428

1429-
"@eslint/eslintrc@^0.2.1":
1430-
version "0.2.1"
1431-
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.2.1.tgz#f72069c330461a06684d119384435e12a5d76e3c"
1432-
integrity sha512-XRUeBZ5zBWLYgSANMpThFddrZZkEbGHgUdt5UJjZfnlN9BGCiUBrf+nvbRupSjMvqzwnQN0qwCmOxITt1cfywA==
1433-
dependencies:
1434-
ajv "^6.12.4"
1435-
debug "^4.1.1"
1436-
espree "^7.3.0"
1437-
globals "^12.1.0"
1438-
ignore "^4.0.6"
1439-
import-fresh "^3.2.1"
1440-
js-yaml "^3.13.1"
1441-
lodash "^4.17.19"
1442-
minimatch "^3.0.4"
1443-
strip-json-comments "^3.1.1"
1444-
1445-
"@eslint/eslintrc@^0.2.1":
1446-
version "0.2.1"
1447-
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.2.1.tgz#f72069c330461a06684d119384435e12a5d76e3c"
1448-
integrity sha512-XRUeBZ5zBWLYgSANMpThFddrZZkEbGHgUdt5UJjZfnlN9BGCiUBrf+nvbRupSjMvqzwnQN0qwCmOxITt1cfywA==
1449-
dependencies:
1450-
ajv "^6.12.4"
1451-
debug "^4.1.1"
1452-
espree "^7.3.0"
1453-
globals "^12.1.0"
1454-
ignore "^4.0.6"
1455-
import-fresh "^3.2.1"
1456-
js-yaml "^3.13.1"
1457-
lodash "^4.17.19"
1458-
minimatch "^3.0.4"
1459-
strip-json-comments "^3.1.1"
1460-
14611429
"@evocateur/libnpmaccess@^3.1.2":
14621430
version "3.1.2"
14631431
resolved "https://registry.yarnpkg.com/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz#ecf7f6ce6b004e9f942b098d92200be4a4b1c845"
@@ -8417,49 +8385,6 @@ eslint@^7.13.0:
84178385
text-table "^0.2.0"
84188386
v8-compile-cache "^2.0.3"
84198387

8420-
eslint@^7.13.0:
8421-
version "7.13.0"
8422-
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.13.0.tgz#7f180126c0dcdef327bfb54b211d7802decc08da"
8423-
integrity sha512-uCORMuOO8tUzJmsdRtrvcGq5qposf7Rw0LwkTJkoDbOycVQtQjmnhZSuLQnozLE4TmAzlMVV45eCHmQ1OpDKUQ==
8424-
dependencies:
8425-
"@babel/code-frame" "^7.0.0"
8426-
"@eslint/eslintrc" "^0.2.1"
8427-
ajv "^6.10.0"
8428-
chalk "^4.0.0"
8429-
cross-spawn "^7.0.2"
8430-
debug "^4.0.1"
8431-
doctrine "^3.0.0"
8432-
enquirer "^2.3.5"
8433-
eslint-scope "^5.1.1"
8434-
eslint-utils "^2.1.0"
8435-
eslint-visitor-keys "^2.0.0"
8436-
espree "^7.3.0"
8437-
esquery "^1.2.0"
8438-
esutils "^2.0.2"
8439-
file-entry-cache "^5.0.1"
8440-
functional-red-black-tree "^1.0.1"
8441-
glob-parent "^5.0.0"
8442-
globals "^12.1.0"
8443-
ignore "^4.0.6"
8444-
import-fresh "^3.0.0"
8445-
imurmurhash "^0.1.4"
8446-
is-glob "^4.0.0"
8447-
js-yaml "^3.13.1"
8448-
json-stable-stringify-without-jsonify "^1.0.1"
8449-
levn "^0.4.1"
8450-
lodash "^4.17.19"
8451-
minimatch "^3.0.4"
8452-
natural-compare "^1.4.0"
8453-
optionator "^0.9.1"
8454-
progress "^2.0.0"
8455-
regexpp "^3.1.0"
8456-
semver "^7.2.1"
8457-
strip-ansi "^6.0.0"
8458-
strip-json-comments "^3.1.0"
8459-
table "^5.2.3"
8460-
text-table "^0.2.0"
8461-
v8-compile-cache "^2.0.3"
8462-
84638388
espree@^7.2.0, espree@^7.3.0:
84648389
version "7.3.0"
84658390
resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.0.tgz#dc30437cf67947cf576121ebd780f15eeac72348"
@@ -14656,23 +14581,23 @@ prelude-ls@~1.1.2:
1465614581
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
1465714582
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
1465814583

14659-
prepend-http@^1.0.0:
14660-
version "1.0.4"
14661-
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
14662-
integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=
14663-
1466414584
prettier-linter-helpers@^1.0.0:
1466514585
version "1.0.0"
1466614586
resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
1466714587
integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
1466814588
dependencies:
1466914589
fast-diff "^1.1.2"
1467014590

14671-
prettier@^2.1.2:
14591+
prettier@2.1.2, prettier@^2.1.2:
1467214592
version "2.1.2"
1467314593
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5"
1467414594
integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==
14675-
14595+
14596+
prettier@~2.0.5:
14597+
version "2.0.5"
14598+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4"
14599+
integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==
14600+
1467614601
pretty-bytes@^3.0.0:
1467714602
version "3.0.1"
1467814603
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-3.0.1.tgz#27d0008d778063a0b4811bb35c79f1bd5d5fbccf"

0 commit comments

Comments
 (0)