Run `npm update` and fix resulting dynamic import error.

For some reason the newer webpack versions can't handle the destructured
assignment from a dynamic import of a JSON file.
This commit is contained in:
JC Brand 2023-06-09 12:34:09 +02:00
parent 8b28ffecfe
commit 1e4937bf41
4 changed files with 859 additions and 1275 deletions

2125
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -104,7 +104,7 @@
"typescript": "^4.9.5",
"typescript-eslint-parser": "^22.0.0",
"uglify-js": "^3.17.4",
"webpack": "^5.72.0",
"webpack": "^5.86.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.8.1",
"webpack-merge": "^5.8.0"

View File

@ -86,8 +86,8 @@ converse.plugins.add('converse-emoji', {
async initialize () {
if (!converse.emojis.initialized) {
converse.emojis.initialized = true;
const { default: json } = await import(/*webpackChunkName: "emojis" */ './emoji.json');
converse.emojis.json = json;
const module = await import(/*webpackChunkName: "emojis" */ './emoji.json');
const json = converse.emojis.json = module.default;
converse.emojis.by_sn = Object.keys(json).reduce((result, cat) => Object.assign(result, json[cat]), {});
converse.emojis.list = Object.values(converse.emojis.by_sn);
converse.emojis.list.sort((a, b) => a.sn < b.sn ? -1 : (a.sn > b.sn ? 1 : 0));

View File

@ -26,6 +26,7 @@
"skipLibCheck": true,
"moduleResolution": "node"
"moduleResolution": "node",
"resolveJsonModule": true
}
}