mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-08-29 10:09:26 +02:00
web: @notesnook-importer/core dynamic import
This commit is contained in:
@@ -17,11 +17,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
IFileProvider,
|
||||
ProviderSettings,
|
||||
transform
|
||||
} from "@notesnook-importer/core";
|
||||
import { IFileProvider, ProviderSettings } from "@notesnook-importer/core";
|
||||
import { formatBytes, getFormattedDate } from "@notesnook/common";
|
||||
import { ScrollContainer } from "@notesnook/ui";
|
||||
import { Button, Flex, Text } from "@theme-ui/components";
|
||||
@@ -127,6 +123,8 @@ export function FileProviderHandler(props: FileProviderHandlerProps) {
|
||||
done: 0
|
||||
});
|
||||
|
||||
const { transform } = await import("@notesnook-importer/core");
|
||||
|
||||
errors.push(
|
||||
...(await transform(
|
||||
provider,
|
||||
|
||||
@@ -69,8 +69,6 @@ export default defineConfig({
|
||||
path.basename(id) !== "index.js"
|
||||
)
|
||||
return `code-lang-${path.basename(id, "js")}`;
|
||||
else if (id.includes("notesnook-importer"))
|
||||
return `notesnook-importer`;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -192,6 +190,7 @@ export default defineConfig({
|
||||
: [
|
||||
prefetchPlugin({
|
||||
excludeFn: (assetName) =>
|
||||
assetName.includes("notesnook-importer") ||
|
||||
assetName.includes("wa-sqlite-async") ||
|
||||
!assetName.includes("wa-sqlite")
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user