Skip to content

Commit

Permalink
Fix call errors
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Ambrosini <marcoambrosini@pm.me>
  • Loading branch information
marcoambrosini committed Jun 17, 2021
1 parent 8055bd4 commit 29f4e1a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
16 changes: 15 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"@vue/cli-service": "^4.5.13",
"@vue/test-utils": "^1.2.0",
"babel-loader-exclude-node-modules-except": "^1.2.1",
"babel-plugin-add-module-exports": "^1.0.4",
"jest-localstorage-mock": "^2.4.14",
"jest-mock-axios": "^4.4.0",
"jest-mock-console": "^1.1.0",
Expand Down
32 changes: 27 additions & 5 deletions webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ const BabelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-m

webpackConfig.entry = {
'admin-settings': path.join(__dirname, 'src', 'mainAdminSettings.js'),
'collections': path.join(__dirname, 'src', 'collections.js'),
'main': path.join(__dirname, 'src', 'main.js'),
collections: path.join(__dirname, 'src', 'collections.js'),
main: path.join(__dirname, 'src', 'main.js'),
'files-sidebar': [
path.join(__dirname, 'src', 'mainFilesSidebar.js'),
path.join(__dirname, 'src', 'mainFilesSidebarLoader.js'),
],
'public-share-auth-sidebar': path.join(__dirname, 'src', 'mainPublicShareAuthSidebar.js'),
'public-share-sidebar': path.join(__dirname, 'src', 'mainPublicShareSidebar.js'),
'flow': path.join(__dirname, 'src', 'flow.js'),
'dashboard': path.join(__dirname, 'src', 'dashboard.js'),
'deck': path.join(__dirname, 'src', 'deck.js'),
flow: path.join(__dirname, 'src', 'flow.js'),
dashboard: path.join(__dirname, 'src', 'dashboard.js'),
deck: path.join(__dirname, 'src', 'deck.js'),
}

// Edit JS rule
Expand Down Expand Up @@ -49,4 +49,26 @@ webpackConfig.module.rules.push({
loader: 'babel-loader',
})

webpackConfig.module.rules.push({
/**
* webrtc-adapter main module does no longer provide
* "module.exports", which is expected by some elements using it
* (like "attachmediastream"), so it needs to be added back with
* a plugin.
*/
test: /node_modules\/webrtc-adapter\/.*\.js$/,
loader: 'babel-loader',
options: {
plugins: ['add-module-exports'],
presets: [
/**
* From "add-module-exports" documentation:
* "webpack doesn't perform commonjs transformation for
* codesplitting. Need to set commonjs conversion."
*/
['@babel/env', { modules: 'commonjs' }],
],
},
},)

module.exports = webpackConfig

0 comments on commit 29f4e1a

Please sign in to comment.