Enable isolatedModules: true

This commit is contained in:
slorber 2021-05-13 20:10:41 +02:00
parent 848621e079
commit e656c350dd
2 changed files with 16 additions and 11 deletions

View file

@ -11,19 +11,23 @@
// TODO this is not ideal and produce a warning! // TODO this is not ideal and produce a warning!
// see https://github.com/webpack/webpack/issues/7713#issuecomment-467888437 // see https://github.com/webpack/webpack/issues/7713#issuecomment-467888437
// note: warning can be filtered: https://github.com/facebook/docusaurus/pull/3382#issuecomment-684966924 // note: warning can be filtered: https://github.com/facebook/docusaurus/pull/3382#issuecomment-684966924
try { function getExport() {
// eslint-disable-next-line global-require try {
module.exports = require('@theme-init/hooks/useDocs'); // eslint-disable-next-line global-require
} catch (e) { return require('@theme-init/hooks/useDocs');
// In case the docs plugin is not available, might be useful to stub some methods here } catch (e) {
// https://github.com/facebook/docusaurus/issues/3947 // In case the docs plugin is not available, might be useful to stub some methods here
const Empty = {}; // https://github.com/facebook/docusaurus/issues/3947
module.exports = { const Empty = {};
useAllDocsData: () => Empty, return {
useActivePluginAndVersion: () => undefined, useAllDocsData: () => Empty,
}; useActivePluginAndVersion: () => undefined,
};
}
} }
export default getExport();
/* /*
throw new Error( throw new Error(
"The docs plugin is not used, so you can't require the useDocs hooks. ", "The docs plugin is not used, so you can't require the useDocs hooks. ",

View file

@ -28,6 +28,7 @@
"moduleResolution": "node", "moduleResolution": "node",
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"esModuleInterop": true, "esModuleInterop": true,
"isolatedModules": true,
/* Advanced Options */ /* Advanced Options */
"resolveJsonModule": true, "resolveJsonModule": true,