Commit 85d4a3a5 authored by Tasso Evangelista's avatar Tasso Evangelista Committed by Guilherme Gazzo

fix: Set a conservative output.environment on Webpack bundles (#330)

parent 84e0a8a2
......@@ -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: {
......@@ -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),
......
......@@ -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: {
......
/node_modules
/dist
!/.eslintrc.js
/webpack.config.js
......@@ -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'],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment