Skip to content

Commit

Permalink
fix: Set a conservative output.environment on Webpack bundles (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan authored and ggazzo committed Nov 16, 2020
1 parent 84e0a8a commit 85d4a3a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
17 changes: 11 additions & 6 deletions packages/fuselage-ui-kit/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,20 @@ module.exports = (env, { mode = 'production' }) => ({
'fuselage-ui-kit': path.resolve(__dirname, 'src/index.js'),
},
output: {
filename: `[name].${ mode }.js`,
filename: `[name].${mode}.js`,
path: path.resolve(__dirname, 'dist'),
library: 'RocketChatFuselageUiKit',
libraryTarget: 'umd',
umdNamedDefine: true,
environment: {
arrowFunction: false,
bigIntLiteral: false,
const: false,
destructuring: false,
dynamicImport: false,
forOf: false,
module: false,
},
},
devtool: mode === 'production' ? false : 'source-map',
module: {
Expand All @@ -28,11 +37,7 @@ module.exports = (env, { mode = 'production' }) => ({
},
],
},
externals: [
'react',
'react-dom',
/^@rocket.chat\//,
],
externals: ['react', 'react-dom', /^@rocket.chat\//],
plugins: [
new webpack.DefinePlugin({
'process.env.VERSION': JSON.stringify(pkg.version),
Expand Down
11 changes: 10 additions & 1 deletion packages/fuselage/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,20 @@ module.exports = (env, { mode = 'production' }) => ({
fuselage: path.resolve(__dirname, 'src/index.js'),
},
output: {
filename: `[name].${ mode }.js`,
filename: `[name].${mode}.js`,
path: path.resolve(__dirname, 'dist'),
library: 'RocketChatFuselage',
libraryTarget: 'umd',
umdNamedDefine: true,
environment: {
arrowFunction: false,
bigIntLiteral: false,
const: false,
destructuring: false,
dynamicImport: false,
forOf: false,
module: false,
},
},
devtool: mode === 'production' ? false : 'source-map',
module: {
Expand Down
1 change: 1 addition & 0 deletions packages/ui-kit/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules
/dist
!/.eslintrc.js
/webpack.config.js
9 changes: 9 additions & 0 deletions packages/ui-kit/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ module.exports = (env, argv) => ({
library: 'RocketChatUiKit',
libraryTarget: 'umd',
umdNamedDefine: true,
environment: {
arrowFunction: false,
bigIntLiteral: false,
const: false,
destructuring: false,
dynamicImport: false,
forOf: false,
module: false,
},
},
resolve: {
extensions: ['.ts', '.tsx', '.js'],
Expand Down

0 comments on commit 85d4a3a

Please sign in to comment.