{"id":393938,"date":"2024-06-29T11:19:09","date_gmt":"2024-06-29T11:19:09","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=393938"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=393938","title":{"rendered":"<span>\u0412\u0434\u0430\u043b\u0438 \u043e\u0442 Webpack, \u0438\u043b\u0438 \u041a\u0430\u043a \u043c\u044b \u0432 Dodo \u043c\u0438\u043a\u0440\u043e\u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u044b \u043d\u0430 Vite \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043b\u0438<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e47\/241\/212\/e47241212bcf7dd667d325f2a74798f6.png\" width=\"1120\" height=\"630\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e47\/241\/212\/e47241212bcf7dd667d325f2a74798f6.png\"\/><\/figure>\n<p><em>\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438, \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 <\/em><a href=\"https:\/\/habr.com\/ru\/company\/dododev\/blog\/712320\/\"><em>\u0432 Dodo \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043c\u0438\u043a\u0440\u043e\u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u044b.<\/em><\/a><em> \u042d\u0442\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435.<\/em><\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u043c\u044b \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0441\u0438\u0434\u0435\u043b\u0438 \u0438 \u043f\u0438\u043b\u0438\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0443\u0441\u0442\u043e\u044f\u0432\u0448\u0435\u043c\u0441\u044f \u0441\u0442\u0435\u043a\u0435 React + TypeScript + Webpack + <a href=\"https:\/\/single-spa.js.org\/\">SingleSPA<\/a> + <a href=\"https:\/\/github.com\/systemjs\/systemjs\">SystemJS<\/a> + Jest. \u041f\u043e\u043a\u0430 \u043e\u0434\u043d\u0438\u043c \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0443\u0442\u0440\u043e\u043c \u043d\u0435 \u043f\u0440\u0438\u0448\u0451\u043b \u0442\u0435\u0445\u043b\u0438\u0434 \u0438 \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u043b: \u00ab\u0427\u0443\u0432\u0430\u043a\u0438, \u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u0442\u0430\u0449\u0438\u043c <a href=\"https:\/\/vitest.dev\/\">Vitest<\/a>!\u00bb.<\/p>\n<h2>\u0427\u0435\u043c \u0436\u0435 \u0445\u043e\u0440\u043e\u0448 Vitest<\/h2>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u044b \u043c\u043d\u043e\u0433\u043e \u0441\u043b\u044b\u0448\u0430\u043b\u0438 \u0438 <a href=\"https:\/\/vitest.dev\/guide\/comparisons.html#jest\">\u0447\u0438\u0442\u0430\u043b\u0438 \u043e \u0442\u043e\u043c<\/a>, \u0447\u0442\u043e Vitest \u0431\u044b\u0441\u0442\u0440\u0435\u0435 Jest. \u041d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0442\u0438 \u00ab\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u00bb \u2014 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0439 Jest, \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043e\u0442\u043b\u0438\u0447\u0438\u044f\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>describe<\/code>, <code>it<\/code> \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <code>vitest<\/code>, \u0430 \u043d\u0435 \u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440: <code>jest.fn()<\/code>, <code>jest.spyOn()<\/code> \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 <code>vi.fn()<\/code>, <code>vi.spyOn()<\/code>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c <code>vi<\/code> \u0442\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 <code>vitest<\/code>.<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0434\u043d\u043e\u0439 \u043e\u043f\u0446\u0438\u0435\u0439 <code>globals: true<\/code>. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438, \u0447\u0442\u043e \u044f\u0432\u043d\u044b\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u2014 \u0431\u043e\u043b\u0435\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439 \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434.<\/p>\n<p>\u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0438 \u0442\u0435\u0441\u0442\u043e\u0432 \u0432 \u043d\u0451\u043c \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0431\u044b\u043b\u043e (10 \u0448\u0442\u0443\u043a), \u043f\u0435\u0440\u0435\u0435\u0437\u0434 \u0431\u044b \u043d\u0430\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u043b. \u0410 \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0439\u0434\u0451\u0442 \u043d\u0435 \u0442\u0430\u043a, \u043f\u0435\u0440\u0435\u0435\u0445\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 Jest \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0442\u0440\u0443\u0434\u0430.<\/p>\n<h2>\u041f\u0435\u0440\u0435\u0435\u0445\u0430\u043b\u0438 \u043d\u0430 Vitest? \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043d\u0430 Vite!<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0435\u0437\u0434 \u043d\u0430 Vitest \u0434\u0430\u043b\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e, \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e 15-20 \u043c\u0438\u043d\u0443\u0442. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438, \u043f\u0440\u043e\u0437\u0432\u0443\u0447\u0430\u043b\u0430 \u0444\u0440\u0430\u0437\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0442\u043e \u0432\u0438\u0442\u0430\u043b\u0430 \u0432 \u0432\u043e\u0437\u0434\u0443\u0445\u0435. \u0413\u043b\u044f\u0434\u044f \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u043b\u044f Vitest <code>vite.config.ts<\/code>, \u043a\u0442\u043e-\u0442\u043e \u0438\u0437 \u043d\u0430\u0441 \u0441\u043a\u0430\u0437\u0430\u043b: \u00ab\u0410 \u043c\u043e\u0436\u0435\u0442, \u0442\u043e\u0433\u0434\u0430 \u0438 \u043d\u0430 Vite \u043f\u0435\u0440\u0435\u0435\u0434\u0435\u043c?\u00bb<\/p>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u00ab\u0437\u0430\u00bb:<\/p>\n<ol>\n<li>\n<p>esbuild, \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432 dev-\u0440\u0435\u0436\u0438\u043c\u0435, \u0441\u0443\u043f\u0435\u0440\u0431\u044b\u0441\u0442\u0440\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0448 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440 \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0435\u0440\u0435\u0435\u0434\u0435\u043c \u0441 Webpack \u043d\u0430 \u0447\u0442\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432!<\/p>\n<\/li>\n<\/ol>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u00ab\u043f\u0440\u043e\u0442\u0438\u0432\u00bb \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0438\u043c\u0435\u043b\u043e\u0441\u044c.<\/p>\n<h2>Ready Steady Go!<\/h2>\n<p>\u041a\u0430\u043a \u043d\u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u043e, \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0435\u0437\u0434\u0435 \u0441 Webpack \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0431\u044b\u043b\u043e. \u041a\u043e\u043d\u0444\u0438\u0433 Vite \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0441\u043e 120 \u0434\u043e 50 \u0441\u0442\u0440\u043e\u043a (\u0432\u043c\u0435\u0441\u0442\u0435 \u0441 Vitest).<\/p>\n<p><a href=\"https:\/\/github.com\/DiFuks\/vite-importmap\"><em>\u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/em><\/a><em>, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 Vite. \u041a\u0430\u0436\u0434\u044b\u0439 \u0448\u0430\u0433 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0432\u044b\u0434\u0435\u043b\u0435\u043d \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0438\u0442.<\/em><\/p>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0441\u0442\u0430\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"typescript\">import react from '@vitejs\/plugin-react'; import process from 'node:process'; import path from 'path'; import { defineConfig, PluginOption } from 'vite'; import checker from 'vite-plugin-checker'; import tsconfigPaths from 'vite-tsconfig-paths';  const rootPath = process.cwd();  export default defineConfig(({ mode }) => {   const plugins: PluginOption[] = [     react(),     tsconfigPaths({       root,     }),   ];    if (mode === `production`) {   plugins.push(checker({ typescript: true }));   }      const root = mode === `test` ? rootPath : path.join(rootPath, `.\/src\/app`);      return {   root,   plugins,   build: {   emptyOutDir: false,   rollupOptions: {   input: path.join(rootPath, `.\/src\/app\/singleSpa.tsx`),   output: {   dir: path.join(rootPath, `.\/dist`),   entryFileNames: `app.[hash].js`,   format: `system`,   },   },   },   server: {   proxy: {   '\/api': { target: `https:\/\/stand.dodois.dev`, secure: false, changeOrigin: true },   '\/swagger': { target: `https:\/\/stand.dodois.dev`, secure: false, changeOrigin: true },   },   },   test: {   globals: true,   environment: `jsdom`,   },   }  });<\/code><\/pre>\n<p>\u0417\u0430 \u0447\u0430\u0441 \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Vite, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0435\u0433\u043e \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 dev-\u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u043b\u0438 \u0431\u0438\u043b\u0434 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u043d\u0434. \u041d\u043e \u043d\u0430 \u0441\u0442\u0435\u043d\u0434\u0435 \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0430 \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u0431\u0435\u043b\u044b\u0439 \u044d\u043a\u0440\u0430\u043d\u2026<\/p>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438, \u0447\u0442\u043e appshell \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 SingleSpa \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u044e\u0442 \u043d\u0430\u0448 \u043c\u0438\u043a\u0440\u043e\u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0436\u0438\u0434\u0430\u044e\u0442, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438: <code>bootsrap<\/code>, <code>mount<\/code>, <code>unmount<\/code>. \u041d\u043e \u0438\u0437-\u0437\u0430 \u043c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0431\u0438\u043b\u0434\u0430 \u0432 prod-\u0440\u0435\u0436\u0438\u043c\u0435 \u0438\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0437\u0430\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u0441\u043e\u043a\u0440\u0430\u0449\u0451\u043d\u043d\u044b\u0435 (<code>b<\/code>, <code>m<\/code>, <code>u<\/code>). \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u044d\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u043e\u043f\u0446\u0438\u0438 <code>vite.config.ts<\/code> <code>preserveEntrySignatures<\/code> \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>strict<\/code>. \u0421\u043d\u043e\u0432\u0430 \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u043b\u0438 \u043d\u0430 \u0441\u0442\u0435\u043d\u0434 \u0438 \u0432\u0441\u0451 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e!<\/p>\n<p>\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c \u0438 \u0440\u0430\u0441\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f. \u041d\u043e \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c import-map-overrides. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043c\u0435\u043d\u0438\u0442\u044c \u0432 prod-\u0440\u0435\u0436\u0438\u043c\u0435 \u0431\u0430\u043d\u0434\u043b \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043d\u0435 \u0437\u0430 \u0433\u043e\u0440\u0430\u043c\u0438 \u0431\u044b\u043b\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 \u0441\u0442\u0435\u043d\u0434\u0435. \u0418 \u043d\u0430 localhost \u043d\u0430\u0448 auth \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u043a\u0443\u043a\u0443. Importmap override \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0448\u0438\u043b \u0431\u044b \u0438 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c import-map-overrides\u2026<\/h2>\n<p>\u0421\u0430\u043c\u0430\u044f \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438\u0434\u0435\u043e\u043b\u043e\u0433\u0438\u0438 Vite \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 ES6 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0435 \u0431\u0438\u043b\u0434\u0438\u0442\u044c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0432\u0435\u0441\u044c \u0431\u0430\u043d\u0434\u043b, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u041d\u043e \u0432\u0441\u0451 \u043d\u0430\u0448\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 importmap \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043d\u0430 SystemJS, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u0432\u0437\u044f\u0442\u044c \u0438 \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u0442\u044c \u043d\u0430\u0448 appshell (SystemJS-\u0438\u043c\u043f\u043e\u0440\u0442\u044b \u0438 SystemJS-importmap) \u0441 Vite-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0441 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 import\/export.<\/p>\n<h3>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0441 SystemJS \u043d\u0430 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 importmap<\/h3>\n<p>\u041c\u044b \u043c\u043e\u0433\u043b\u0438 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0432 \u043b\u043e\u0431: \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0431\u0430\u043d\u0434\u043b \u0432 \u043e\u0434\u0438\u043d JS-\u0444\u0430\u0439\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/rollupjs.org\/\">rollup<\/a> (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u0432 Vite) \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a SystemJS-\u043c\u043e\u0434\u0443\u043b\u044c. \u041d\u043e \u0442\u043e\u0433\u0434\u0430 \u043c\u044b \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0442\u043e\u0442 \u0436\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f, \u0447\u0442\u043e \u0438 \u0432 Webpack, \u043f\u043e\u0442\u0435\u0440\u044f\u0432 \u0432\u0441\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043d\u0430\u0448 appshell, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Webpack \u0438 \u0437\u0430\u0442\u043e\u0447\u0435\u043d \u043d\u0430 SystemJS, \u043d\u0430 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 importmap.<\/p>\n<p>\u041a\u0430\u043a \u0431\u044b\u043b\u043e \u0434\u043e:<\/p>\n<pre><code class=\"typescript\">import { LifeCycles, registerApplication, start } from 'single-spa'; import 'systemjs'; import 'import-map-overrides';  registerApplication(   `app`,   () => System.import&lt;LifeCycles>(app),   location => location.pathname.startsWith(\/), );    start(); <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u0441\u043b\u0435:<\/p>\n<pre><code class=\"typescript\">import { registerApplication, start } from 'single-spa'; import 'import-map-overrides';  registerApplication(   `app`,   \/\/ eslint-disable-next-line @typescript-eslint\/ban-ts-comment   \/\/ @ts-ignore   () => import(\/* webpackIgnore: true *\/ app),   location => location.pathname.startsWith(\/), );  start(); <\/code><\/pre>\n<p><em>webpackIgnore: true \u0434\u0430\u0451\u0442 Webpack \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0442 lazy-load \u0438 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u0434\u0441\u043f\u043b\u0438\u0442\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0435 \u043d\u0443\u0436\u043d\u043e. @ts-ignore, \u0447\u0442\u043e\u0431\u044b TypeScript \u043d\u0435 \u0440\u0443\u0433\u0430\u043b\u0441\u044f \u043d\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f app, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e importmap.<\/em><\/p>\n<p>\u0412 <code>index.html<\/code> \u0444\u0430\u0439\u043b\u0435 appshell \u043c\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u043b\u0438 \u0442\u0438\u043f importmap \u0441 SystemJS \u043d\u0430 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435.<\/p>\n<p>\u0414\u043e:<\/p>\n<pre><code class=\"xml\">&lt;meta name=\"importmap-type\" content=\"systemjs-importmap\" \/> &lt;import-map-overrides-full show-when-local-storage=\"devtools\">&lt;\/import-map-overrides-full> &lt;script type=\"systemjs-importmap\" src=\"&lt;http:\/\/cdn.dodois.dev\/importmap.json>\">&lt;\/script>  &lt;div id=\"single-spa-application:app\">&lt;\/div>  &lt;script defer=\"defer\" src=\"\/appshell.bundle.js\">&lt;\/script> <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435:<\/p>\n<pre><code class=\"xml\">&lt;meta name=\"importmap-type\" content=\"importmap\" \/> &lt;import-map-overrides-full show-when-local-storage=\"devtools\">&lt;\/import-map-overrides-full> &lt;script type=\"importmap\" src=\"&lt;http:\/\/cdn.dodois.dev\/importmap.json>\">&lt;\/script>  &lt;div id=\"single-spa-application:app\">&lt;\/div>  &lt;script type=\"module\" defer=\"defer\" src=\"\/appshell.bundle.js\">&lt;\/script> <\/code><\/pre>\n<p>\u0410 \u0435\u0449\u0451 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u043e\u043f\u0446\u0438\u044e <code>build.rollupOptions.output.format<\/code> \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>module<\/code>.<\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 external importmap<\/h3>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0445\u043e\u0442\u044c importmap \u0438 <a href=\"https:\/\/html.spec.whatwg.org\/multipage\/webappapis.html#import-maps\">\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 HTML<\/a>, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0433\u0440\u0443\u0441\u0442\u043d\u0430\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0432\u043e\u0435, \u0441 \u0447\u0435\u043c \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c, \u043e\u0442\u043a\u0440\u044b\u0432 Chrome, \u2014 <code>External import maps are not yet supported<\/code>. <a href=\"https:\/\/github.com\/WICG\/import-maps\/issues\/235\">\u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442<\/a>, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c importmap \u0447\u0435\u0440\u0435\u0437 <code>src<\/code> \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u043e\u043f\u0438\u0441\u0430\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u043b\u0430 \u0442\u0435\u0433\u0430 <code>script<\/code>. <\/p>\n<p>\u041e\u043a\u0435\u0439, \u0432 \u0442\u0435\u043e\u0440\u0438\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c importmap \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>fetch<\/code> \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 DOM. \u042d\u0442\u043e \u043d\u0430\u043c Chrome \u043d\u0435 \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442. \u0413\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b importmap \u0431\u044b\u043b\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u043c\u043e\u0434\u0443\u043b\u044f. \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u043f\u043e\u0441\u043b\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0445\u043e\u0442\u044f \u0431\u044b \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0451\u043c <code>script<\/code> \u0442\u0435\u0433 \u0447\u0435\u0440\u0435\u0437 JS, \u043d\u043e \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0431\u0435\u0437 <code>fetch<\/code>:<\/p>\n<pre><code class=\"xml\">&lt;script>   const im = document.createElement('script');   im.type = 'importmap';   im.textContent = JSON.stringify({     \"imports\": {       \"app\": \"&lt;http:\/\/cdn.dodois.dev\/singleSpa.js>\"     }   });   document.currentScript.after(im); &lt;\/script> <\/code><\/pre>\n<p><code>type<\/code><em> \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f \u0441 <\/em><code>importmap<\/code><em> \u043d\u0430 <\/em><code>overridable-importmap<\/code>.<\/p>\n<p>\u0418 \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e!<\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 importmap<\/h3>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c override \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0430\u043d\u0434\u043b, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443: <code>Multiple import maps are not yet supported.<\/code> \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432 \u0431\u0430\u0433\u0442\u0440\u0435\u043a\u0435\u0440\u0435 Chrome \u0443\u0436\u0435 \u0442\u0440\u0438 \u0433\u043e\u0434\u0430 <a href=\"https:\/\/crbug.com\/927119\">\u0432\u0438\u0441\u0438\u0442 issue<\/a> \u0441 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. \u0418, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0438\u0441\u043f\u0440\u0430\u0432\u044f\u0442 \u044d\u0442\u043e \u043d\u0435 \u0441\u043a\u043e\u0440\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 importmap \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f <a href=\"https:\/\/github.com\/WICG\/import-maps\/#multiple-import-map-support\">\u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/a>. \u0414\u043b\u044f \u043d\u0430\u0441 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u0443\u044e importmap \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e importmap \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0430\u043d\u0434\u043b.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 import-map-overrides <a href=\"https:\/\/github.com\/single-spa\/import-map-overrides\/blob\/main\/docs\/configuration.md#client-side-single-map\">\u044d\u0442\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438<\/a>. \u041f\u043e \u0441\u0443\u0442\u0438, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u0438 \u043e\u0434\u043d\u0430 importmap, \u0430 import-map-overrides \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u0435\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u00ab\u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0443\u00bb \u0441 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439. \u041f\u043e \u0438\u0442\u043e\u0433\u0443 \u043a\u043e\u0434 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f:<\/p>\n<pre><code class=\"xml\">&lt;script>   const im = document.createElement('script');   im.type = 'overridable-importmap';   im.textContent = JSON.stringify({     \"imports\": {       \"app\": \"&lt;http:\/\/cdn.dodois.dev\/singleSpa.js>\"     }   });   document.currentScript.after(im); &lt;\/script> <\/code><\/pre>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 hot reload<\/h3>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f importmap \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 <code>Uncaught Error: application 'app' died in status LOADING_SOURCE_CODE: @vitejs\/plugin-react can't detect preamble. Something is wrong.<\/code><\/p>\n<p>\u042d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043d\u0430\u0448 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0430\u043d\u0434\u043b \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c\u0443 dev-\u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b hot module replacement. \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0442\u0430\u043a\u0436\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u043f\u043e\u0442\u043e\u043c. \u041f\u043e\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b\u0438 HMR \u0432 vite.config \u0434\u043b\u044f React-\u043f\u043b\u0430\u0433\u0438\u043d\u0430:<\/p>\n<pre><code class=\"typescript\">const options: Options = mode === `dev-single-spa` ? { exclude: \/.*\/,   } : {} \/\/ ... plugins: [react(options)], <\/code><\/pre>\n<h3>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 importmap \u0441 \u0431\u044d\u043a\u0430<\/h3>\n<p>\u0421\u043d\u043e\u0432\u0430 \u0432\u0441\u0451 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0442\u0435\u0445\u0434\u043e\u043b\u0433, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c importmap \u0441 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e cdn \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e fetch:<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0432 HTML appshell:<\/p>\n<pre><code class=\"typescript\">const im = document.createElement('script'); im.type = 'overridable-importmap';  const loadImportmap = async () => {   const result = await fetch(`http:\/\/cdn.dodois.dev\/importmap.json>`);                    const importmap = await result.json();    im.textContent = JSON.stringify(importmap);    document.currentScript.after(im); }  loadImportmap(); <\/code><\/pre>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u043e\u0447\u0435\u0440\u0435\u0434\u044c\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/h3>\n<p>\u0418 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u0442\u044b\u043a\u0430\u0435\u043c\u0441\u044f \u0435\u0449\u0451 \u043d\u0430 \u0434\u0432\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, <code>document.currentScript.after<\/code> \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043b\u043b\u0431\u044d\u043a\u0435. \u00af\\<em>(\u30c4)<\/em>\/\u00af<\/p>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e importmap \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0431\u0430\u043d\u0434\u043b\u0430 \u0441 appshell. \u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u043d\u0430\u0442\u044c, \u043e\u0442\u043a\u0443\u0434\u0430 \u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043d\u0430\u0448 \u043c\u0438\u043a\u0440\u043e\u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 HTML \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0441\u044f \u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u0445 \u0438 \u0441\u0442\u0430\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"typescript\">const loadImportmap = async () => {   const result = await fetch('&lt;http:\/\/cdn.dodois.dev\/importmap.json>');   const importmap = await result.json();    const imScript = document.createElement('script');   imScript.type = 'overridable-importmap';   imScript.textContent = JSON.stringify(importmap);   document.head.append(imScript);    const imOverrideScript = document.createElement('script');   imOverrideScript.src = '\/importmapOverride.bundle.js';   imOverrideScript.onload = () => {       const appShellScript = document.createElement('script');       appShellScript.type = 'module';       appShellScript.defer = true;       appShellScript.src = '\/appshell.bundle.js';          document.head.append(appShellScript);   }    document.head.append(imOverrideScript);  }  loadImportmap() <\/code><\/pre>\n<p><em>\u0417\u0434\u0435\u0441\u044c <\/em><code>importmapOverride.bundle.js<\/code><em> \u2014 \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0431\u0430\u043d\u0434\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043f\u0430\u043a\u0435\u0442\u0430 <\/em><code>import-map-overrides<\/code><em>. \u0410 \u0432 <\/em><code>appshell.bundle.js<\/code><em> \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a\u043e\u0434 appshell.<\/em><\/p>\n<p>\u0412\u0441\u0451! \u0412\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 (\u043a\u0440\u043e\u043c\u0435 HMR), \u043d\u043e \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0442\u0435\u0445\u043b\u0438\u0434 \u0438 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442: \u00ab\u0410 \u0432 Safari \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?\u00bb.<\/p>\n<h3>\u0412 Safari \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 importmap \u0432\u043e\u043e\u0431\u0449\u0435 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c es-module-shims<\/h3>\n<p>\u0414\u0430\u2026 \u041c\u044b \u0437\u0430\u0431\u044b\u043b\u0438 \u043f\u0440\u043e Safari. \u041f\u0440\u0438 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u043f\u043e\u0434 iOS Safari.<\/p>\n<p>\u041a\u0430\u043a \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c, Safari \u0434\u0430\u0436\u0435 \u0432 \u0443\u0440\u0435\u0437\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 importmap. \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u043e\u043b\u0438\u0444\u0438\u043b\u2026 \u0418 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u0432\u0438\u0434\u0435 es-module-shim. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0435\u0433\u043e \u0432 \u043d\u0430\u0448 appshell. \u0422\u0435\u043f\u0435\u0440\u044c index.html \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"xml\">&lt;html> &lt;body> &lt;meta name=\"importmap-type\" content=\"importmap-shim\" \/> &lt;import-map-overrides-full show-when-local-storage=\"devtools\">&lt;\/import-map-overrides-full> &lt;script type=\"importmap-shim\" src=\"&lt;http:\/\/cdn.dodois.dev\/importmap.json>\">&lt;\/script> &lt;script>   window.esmsInitOptions = {     mapOverrides: true,   } &lt;\/script> &lt;script src=\"\/importmapOverride.bundle.js\">&lt;\/script>    &lt;div id=\"single-spa-application:app\">&lt;\/div>  &lt;script type=\"module-shim\" defer=\"defer\" src=\"\/appshell.bundle.js\">&lt;\/script> &lt;\/body> &lt;\/html> <\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u043a\u0440\u0443\u0433 \u0437\u0430\u043c\u043a\u043d\u0443\u043b\u0441\u044f \u0438 \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043d\u0430\u0447\u0430\u043b\u0438. \u0422\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0432\u043c\u0435\u0441\u0442\u043e SystemJS es-module-shim.<\/p>\n<p>\u041d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438. \u0418 \u0442\u043e\u043b\u044c\u043a\u043e appshell \u0431\u0443\u0434\u0435\u0442 \u0437\u043d\u0430\u0442\u044c \u043e \u043f\u043e\u043b\u0438\u0444\u0438\u043b\u0435. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0436\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0431\u0438\u043b\u0434\u0438\u0442\u044c \u0441 <code>target: module<\/code> \u0438 \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 es-module-shim \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0434\u0432\u0443\u0445 \u0440\u0435\u0436\u0438\u043c\u0430\u0445: \u043f\u043e\u043b\u0438\u0444\u0438\u043b\u0430 \u0438, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, shim.<\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u043f\u043e\u043b\u0438\u0444\u0438\u043b\u044f\u0442\u0441\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 importmap, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f, \u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u041d\u043e \u0442\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442, \u0435\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0421hrome, \u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u0441\u043d\u043e\u0432\u0430 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0443\u0442  \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c <a href=\"https:\/\/github.com\/guybedford\/es-module-shims#external-import-maps\">external importmap<\/a>, <a href=\"https:\/\/github.com\/guybedford\/es-module-shims#multiple-import-maps\">multiple importmap<\/a> \u0438 \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0441\u0442\u044b\u043b\u0438.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u043b\u0438\u0444\u0438\u043b, \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043a \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u2014 \u0441 \u044d\u0442\u0438\u043c, \u0441\u0443\u0434\u044f \u043f\u043e \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430\u043c, \u0443 es-module-shim \u0442\u043e\u0436\u0435 \u0432\u0441\u0451 <a href=\"https:\/\/github.com\/guybedford\/es-module-shims\/blob\/main\/bench\/README.md\">\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e<\/a>.<\/p>\n<h3>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c HMR, \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043c<\/h3>\n<p>\u0412\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043a\u0440\u043e\u043c\u0435 HMR. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u043d\u0435\u043c\u0443. \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c HMR, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 index.html appshell:<\/p>\n<pre><code class=\"typescript\">window.addEventListener(\"import-map-overrides:init\", () => {   const isEnabledOverride = !window.importMapOverrides.isDisabled('app');    if (isEnabledOverride) {     const overrideMap = window.importMapOverrides.getOverrideMap();        const appModuleUrl = overrideMap.imports.app;        const { origin } = new URL(appModuleUrl);        const viteClientScript = document.createElement('script');     viteClientScript.src = `${origin}\/@vite\/client`;     viteClientScript.type = 'module-shim';     document.head.append(viteClientScript);        const reactHmrScript = document.createElement('script');     reactHmrScript.type = 'module-shim';     reactHmrScript.innerHTML = `         import RefreshRuntime from '${origin}\/@react-refresh';         RefreshRuntime.injectIntoGlobalHook(window);         window.$RefreshReg$ = () => {};         window.$RefreshSig$ = () => (type) => type;         window.__vite_plugin_react_preamble_installed__ = true;       `     document.head.append(reactHmrScript);   } }); <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c, \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u043b\u0438 importmap-overrides \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u0430\u043d\u0434\u043b\u0430. \u0418 \u0435\u0441\u043b\u0438 \u0434\u0430, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 Vite \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b HMR \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 dev-\u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0435 \u0437\u0430\u0441\u043e\u0440\u044f\u043b HTML, \u043c\u044b \u0432\u044b\u0434\u0435\u043b\u0438\u043b\u0438 \u0435\u0433\u043e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0438 \u0431\u0438\u043b\u0434\u0438\u043c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 shim-\u043f\u043e\u043b\u0438\u0444\u0438\u043b\u043e\u043c \u0438 import-map-overrides. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u043c\u0438 \u043c\u0438\u043a\u0440\u043e\u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430\u043c\u0438 (\u0442\u043e\u0447\u043d\u0435\u0435, \u0438\u0445 appshell).<\/p>\n<h3>\u0411\u043e\u043d\u0443\u0441: \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c SWC<\/h3>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0435\u0437\u0434\u043e\u043c \u043d\u0430 Vite, \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043d\u0430 \u043d\u043e\u0432\u043e\u0441\u0442\u044c \u043e \u0441\u0443\u043f\u0435\u0440\u0431\u044b\u0441\u0442\u0440\u043e\u043c TurboPack. \u0412\u043e \u0432\u0441\u0435\u0445 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442 \u0435\u0433\u043e \u0441 Vite \u0438 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043e \u0442\u043e\u043c, <a href=\"https:\/\/turbo.build\/pack\">\u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0435\u0433\u043e \u043e\u043f\u0435\u0440\u0435\u0436\u0430\u044e\u0442<\/a>. \u042d\u0432\u0430\u043d \u042e <a href=\"https:\/\/github.com\/yyx990803\/vite-vs-next-turbo-hmr\/discussions\/8\">\u0432 \u0441\u0432\u043e\u0435\u0439 \u043e\u0442\u0432\u0435\u0442\u043a\u0435<\/a> \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 React \u0432 dev-\u0440\u0435\u0436\u0438\u043c\u0435. \u0410 \u0443 \u043d\u0435\u0433\u043e \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c Babel. \u0412\u043e\u0442 \u0435\u0441\u043b\u0438 \u0431\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 TurboPack \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430 Vite \u0441 SWC\u2026 \u041d\u0443, \u043c\u044b \u0438 \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u043b\u0438 \u0435\u0449\u0451 \u0438 SWC. Dev-\u0441\u0431\u043e\u0440\u043a\u0430 \u0441\u0442\u0430\u043b\u0430 \u0435\u0449\u0451 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u043d\u043e \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043c\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u043b\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e\u0435\u043a\u0442 \u0435\u0449\u0451 \u0441\u043e\u0432\u0441\u0435\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0442\u043e\u043c.<\/p>\n<h2>\u041a\u0430\u043a \u0436\u0438\u0442\u044c \u0441\u043e \u0432\u0441\u0435\u043c \u044d\u0442\u0438\u043c \u0431\u043e\u0433\u0430\u0442\u0441\u0442\u0432\u043e\u043c<\/h2>\n<p>\u0412\u0441\u0435 \u043d\u043e\u0432\u044b\u0435 \u043c\u0438\u043a\u0440\u043e\u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0432\u044f\u0437\u043a\u0435 appshell \u0441 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0430\u043c\u0438 \u043f\u043b\u044e\u0441 \u0441\u0431\u043e\u0440\u043a\u0430 \u043c\u0438\u043a\u0440\u043e\u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430 \u043d\u0430 Vite. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438-\u0430\u043d\u0430\u043b\u043e\u0433\u0438 create-react-app \u0438 react-scripts, \u0442\u043e\u043b\u044c\u043a\u043e \u0441 Vite \u0438 \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0440\u043a\u0430\u0441\u0430 \u043c\u0438\u043a\u0440\u043e\u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430. \u0412 \u044d\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e, \u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c-\u0444\u0443\u043b\u043b\u0441\u0442\u0435\u043a\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u044e\u0430\u043d\u0441\u044b \u0442\u0443\u043b\u0438\u043d\u0433\u0430. \u0410 \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u0435\u0441\u043b\u0438 \u0441\u0430\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e, \u0437\u0430 \u043f\u0430\u0440\u0443 \u0434\u043d\u0435\u0439. \u0421 Webpack \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c (\u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0441 Yarn PnP), JavaScript API \u0441\u043b\u043e\u0436\u043d\u043e\u0435 \u0438 \u043d\u0435\u0433\u0438\u0431\u043a\u043e\u0435, \u043a\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0441\u044f \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u0438\u043c \u0438 \u043a\u043e\u0441\u0442\u044b\u043b\u044c\u043d\u044b\u043c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0436\u0435 appshell \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043a\u0440\u043e\u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u043e\u0432, \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u043d\u0430 Vite \u0437\u0430\u0442\u0440\u0430\u0442\u043d\u043e, \u0430 \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u044d\u0442\u043e\u0442 appshell \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u043e, \u0442\u043e \u0434\u0430\u0451\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u0438\u043b\u0434\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 SystemJS \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Vite \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 preview, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u0435\u043d <code>import-map-overrides<\/code>. \u041f\u043e \u0441\u0443\u0442\u0438, \u0434\u0430\u0436\u0435 \u0432 dev-\u0440\u0435\u0436\u0438\u043c\u0435 \u0431\u0430\u043d\u0434\u043b \u0431\u0438\u043b\u0434\u0438\u0442\u0441\u044f \u0432 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b, \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f HTTP-server, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0445\u043e\u0441\u0442\u0438\u0442. HMR \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0431\u0438\u043b\u0434 \u0432 \u0440\u0430\u0437\u044b \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435. \u041d\u043e \u0434\u043b\u044f \u043c\u0435\u043b\u043a\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u043e\u0447\u043a\u0438 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442. \u0415\u0441\u043b\u0438 \u0436\u0435 <code>import-map-overrides<\/code> \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u0441\u0443\u043f\u0435\u0440\u0431\u044b\u0441\u0442\u0440\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430.<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u0441 Vite \u043d\u0430\u043c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u041f\u043e\u0441\u043b\u0435 Webpack \u044d\u0442\u043e \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u0433\u043b\u043e\u0442\u043e\u043a \u0441\u0432\u0435\u0436\u0435\u0433\u043e \u0432\u043e\u0437\u0434\u0443\u0445\u0430. \u041d\u0438\u0447\u0435\u0433\u043e \u043b\u0438\u0448\u043d\u0435\u0433\u043e, \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0451 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u043b\u043d\u0438\u0435\u043d\u043e\u0441\u043d\u0430\u044f. \u0418\u043d\u043e\u0433\u0434\u0430, \u043f\u0440\u0430\u0432\u0434\u0430, \u0432\u0435\u0435\u0442 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u0430\u0433\u0438\u0435\u0439 \u2014 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b \u043f\u043b\u0430\u0433\u0438\u043d, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432, \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0435\u0434\u043e\u0432\u0435\u0440\u0438\u0435, \u0436\u0434\u0451\u0448\u044c \u043f\u043e\u0434\u0432\u043e\u0445\u0430. \u0418 \u043e\u043d\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0432\u0430\u044e\u0442 \u2014 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Yarn PnP \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 SWC (\u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 SWC-\u043f\u043b\u0430\u0433\u0438\u043d\u0430\u043c\u0438). \u041d\u043e \u0432\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0440\u0435\u0448\u0430\u0435\u043c\u044b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0431\u0435\u0437 \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439.<\/p>\n<p><em>\u0412 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u0438\u043a\u0440\u043e\u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c. \u0425\u043e\u0442\u0435\u043b\u0438 \u0431\u044b \u0432\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0438\u0445 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0435?<\/em><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><\/p>\n<div class=\"tm-article-poll-container\"><!--[--><\/p>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/companies\/dododev\/articles\/715988\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u041e \u0447\u0435\u043c \u0432\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0431\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">42.86% <\/span><span class=\"tm-article-poll__answer-label\">\u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0438\u0442\u0435 \u043e\u0431 \u043e\u043f\u044b\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Yarn 3.<\/span><span class=\"tm-article-poll__answer-votes\">24<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 42.86%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">80.36% <\/span><span class=\"tm-article-poll__answer-label\">\u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0438\u0442\u0435 \u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u0438\u043a\u0440\u043e\u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u043e\u0432.<\/span><span class=\"tm-article-poll__answer-votes\">45<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 80.36%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 56 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.   \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0438\u0441\u044c 4 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. <\/div>\n<p><!--]--><\/div>\n<p><!--]--><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/715988\/\"> https:\/\/habr.com\/ru\/articles\/715988\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p><em>\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438, \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 <\/em><a href=\"https:\/\/habr.com\/ru\/company\/dododev\/blog\/712320\/\"><em>\u0432 Dodo \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043c\u0438\u043a\u0440\u043e\u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u044b.<\/em><\/a><em> \u042d\u0442\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435.<\/em><\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u043c\u044b \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0441\u0438\u0434\u0435\u043b\u0438 \u0438 \u043f\u0438\u043b\u0438\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0443\u0441\u0442\u043e\u044f\u0432\u0448\u0435\u043c\u0441\u044f \u0441\u0442\u0435\u043a\u0435 React + TypeScript + Webpack + <a href=\"https:\/\/single-spa.js.org\/\">SingleSPA<\/a> + <a href=\"https:\/\/github.com\/systemjs\/systemjs\">SystemJS<\/a> + Jest. \u041f\u043e\u043a\u0430 \u043e\u0434\u043d\u0438\u043c \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0443\u0442\u0440\u043e\u043c \u043d\u0435 \u043f\u0440\u0438\u0448\u0451\u043b \u0442\u0435\u0445\u043b\u0438\u0434 \u0438 \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u043b: \u00ab\u0427\u0443\u0432\u0430\u043a\u0438, \u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u0442\u0430\u0449\u0438\u043c <a href=\"https:\/\/vitest.dev\/\">Vitest<\/a>!\u00bb.<\/p>\n<h2>\u0427\u0435\u043c \u0436\u0435 \u0445\u043e\u0440\u043e\u0448 Vitest<\/h2>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u044b \u043c\u043d\u043e\u0433\u043e \u0441\u043b\u044b\u0448\u0430\u043b\u0438 \u0438 <a href=\"https:\/\/vitest.dev\/guide\/comparisons.html#jest\">\u0447\u0438\u0442\u0430\u043b\u0438 \u043e \u0442\u043e\u043c<\/a>, \u0447\u0442\u043e Vitest \u0431\u044b\u0441\u0442\u0440\u0435\u0435 Jest. \u041d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0442\u0438 \u00ab\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u00bb \u2014 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0439 Jest, \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043e\u0442\u043b\u0438\u0447\u0438\u044f\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>describe<\/code>, <code>it<\/code> \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <code>vitest<\/code>, \u0430 \u043d\u0435 \u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440: <code>jest.fn()<\/code>, <code>jest.spyOn()<\/code> \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 <code>vi.fn()<\/code>, <code>vi.spyOn()<\/code>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c <code>vi<\/code> \u0442\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 <code>vitest<\/code>.<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0434\u043d\u043e\u0439 \u043e\u043f\u0446\u0438\u0435\u0439 <code>globals: true<\/code>. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438, \u0447\u0442\u043e \u044f\u0432\u043d\u044b\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u2014 \u0431\u043e\u043b\u0435\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439 \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434.<\/p>\n<p>\u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0438 \u0442\u0435\u0441\u0442\u043e\u0432 \u0432 \u043d\u0451\u043c \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0431\u044b\u043b\u043e (10 \u0448\u0442\u0443\u043a), \u043f\u0435\u0440\u0435\u0435\u0437\u0434 \u0431\u044b \u043d\u0430\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u043b. \u0410 \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0439\u0434\u0451\u0442 \u043d\u0435 \u0442\u0430\u043a, \u043f\u0435\u0440\u0435\u0435\u0445\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 Jest \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0442\u0440\u0443\u0434\u0430.<\/p>\n<h2>\u041f\u0435\u0440\u0435\u0435\u0445\u0430\u043b\u0438 \u043d\u0430 Vitest? \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043d\u0430 Vite!<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0435\u0437\u0434 \u043d\u0430 Vitest \u0434\u0430\u043b\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e, \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e 15-20 \u043c\u0438\u043d\u0443\u0442. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438, \u043f\u0440\u043e\u0437\u0432\u0443\u0447\u0430\u043b\u0430 \u0444\u0440\u0430\u0437\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0442\u043e \u0432\u0438\u0442\u0430\u043b\u0430 \u0432 \u0432\u043e\u0437\u0434\u0443\u0445\u0435. \u0413\u043b\u044f\u0434\u044f \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u043b\u044f Vitest <code>vite.config.ts<\/code>, \u043a\u0442\u043e-\u0442\u043e \u0438\u0437 \u043d\u0430\u0441 \u0441\u043a\u0430\u0437\u0430\u043b: \u00ab\u0410 \u043c\u043e\u0436\u0435\u0442, \u0442\u043e\u0433\u0434\u0430 \u0438 \u043d\u0430 Vite \u043f\u0435\u0440\u0435\u0435\u0434\u0435\u043c?\u00bb<\/p>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u00ab\u0437\u0430\u00bb:<\/p>\n<ol>\n<li>\n<p>esbuild, \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432 dev-\u0440\u0435\u0436\u0438\u043c\u0435, \u0441\u0443\u043f\u0435\u0440\u0431\u044b\u0441\u0442\u0440\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0448 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440 \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0435\u0440\u0435\u0435\u0434\u0435\u043c \u0441 Webpack \u043d\u0430 \u0447\u0442\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432!<\/p>\n<\/li>\n<\/ol>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u00ab\u043f\u0440\u043e\u0442\u0438\u0432\u00bb \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0438\u043c\u0435\u043b\u043e\u0441\u044c.<\/p>\n<h2>Ready Steady Go!<\/h2>\n<p>\u041a\u0430\u043a \u043d\u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u043e, \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0435\u0437\u0434\u0435 \u0441 Webpack \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0431\u044b\u043b\u043e. \u041a\u043e\u043d\u0444\u0438\u0433 Vite \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0441\u043e 120 \u0434\u043e 50 \u0441\u0442\u0440\u043e\u043a (\u0432\u043c\u0435\u0441\u0442\u0435 \u0441 Vitest).<\/p>\n<p><a href=\"https:\/\/github.com\/DiFuks\/vite-importmap\"><em>\u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/em><\/a><em>, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 Vite. \u041a\u0430\u0436\u0434\u044b\u0439 \u0448\u0430\u0433 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0432\u044b\u0434\u0435\u043b\u0435\u043d \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0438\u0442.<\/em><\/p>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0441\u0442\u0430\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"typescript\">import react from '@vitejs\/plugin-react'; import process from 'node:process'; import path from 'path'; import { defineConfig, PluginOption } from 'vite'; import checker from 'vite-plugin-checker'; import tsconfigPaths from 'vite-tsconfig-paths';  const rootPath = process.cwd();  export default defineConfig(({ mode }) => {   const plugins: PluginOption[] = [     react(),     tsconfigPaths({       root,     }),   ];    if (mode === `production`) {   plugins.push(checker({ typescript: true }));   }      const root = mode === `test` ? rootPath : path.join(rootPath, `.\/src\/app`);      return {   root,   plugins,   build: {   emptyOutDir: false,   rollupOptions: {   input: path.join(rootPath, `.\/src\/app\/singleSpa.tsx`),   output: {   dir: path.join(rootPath, `.\/dist`),   entryFileNames: `app.[hash].js`,   format: `system`,   },   },   },   server: {   proxy: {   '\/api': { target: `https:\/\/stand.dodois.dev`, secure: false, changeOrigin: true },   '\/swagger': { target: `https:\/\/stand.dodois.dev`, secure: false, changeOrigin: true },   },   },   test: {   globals: true,   environment: `jsdom`,   },   }  });<\/code><\/pre>\n<p>\u0417\u0430 \u0447\u0430\u0441 \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Vite, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0435\u0433\u043e \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 dev-\u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u043b\u0438 \u0431\u0438\u043b\u0434 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u043d\u0434. \u041d\u043e \u043d\u0430 \u0441\u0442\u0435\u043d\u0434\u0435 \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0430 \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u0431\u0435\u043b\u044b\u0439 \u044d\u043a\u0440\u0430\u043d\u2026<\/p>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438, \u0447\u0442\u043e appshell \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 SingleSpa \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u044e\u0442 \u043d\u0430\u0448 \u043c\u0438\u043a\u0440\u043e\u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0436\u0438\u0434\u0430\u044e\u0442, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438: <code>bootsrap<\/code>, <code>mount<\/code>, <code>unmount<\/code>. \u041d\u043e \u0438\u0437-\u0437\u0430 \u043c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0431\u0438\u043b\u0434\u0430 \u0432 prod-\u0440\u0435\u0436\u0438\u043c\u0435 \u0438\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0437\u0430\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u0441\u043e\u043a\u0440\u0430\u0449\u0451\u043d\u043d\u044b\u0435 (<code>b<\/code>, <code>m<\/code>, <code>u<\/code>). \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u044d\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u043e\u043f\u0446\u0438\u0438 <code>vite.config.ts<\/code> <code>preserveEntrySignatures<\/code> \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>strict<\/code>. \u0421\u043d\u043e\u0432\u0430 \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u043b\u0438 \u043d\u0430 \u0441\u0442\u0435\u043d\u0434 \u0438 \u0432\u0441\u0451 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e!<\/p>\n<p>\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c \u0438 \u0440\u0430\u0441\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f. \u041d\u043e \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c import-map-overrides. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043c\u0435\u043d\u0438\u0442\u044c \u0432 prod-\u0440\u0435\u0436\u0438\u043c\u0435 \u0431\u0430\u043d\u0434\u043b \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043d\u0435 \u0437\u0430 \u0433\u043e\u0440\u0430\u043c\u0438 \u0431\u044b\u043b\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 \u0441\u0442\u0435\u043d\u0434\u0435. \u0418 \u043d\u0430 localhost \u043d\u0430\u0448 auth \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u043a\u0443\u043a\u0443. Importmap override \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0448\u0438\u043b \u0431\u044b \u0438 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c import-map-overrides\u2026<\/h2>\n<p>\u0421\u0430\u043c\u0430\u044f \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438\u0434\u0435\u043e\u043b\u043e\u0433\u0438\u0438 Vite \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 ES6 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0435 \u0431\u0438\u043b\u0434\u0438\u0442\u044c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0432\u0435\u0441\u044c \u0431\u0430\u043d\u0434\u043b, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u041d\u043e \u0432\u0441\u0451 \u043d\u0430\u0448\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 importmap \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043d\u0430 SystemJS, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u0432\u0437\u044f\u0442\u044c \u0438 \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u0442\u044c \u043d\u0430\u0448 appshell (SystemJS-\u0438\u043c\u043f\u043e\u0440\u0442\u044b \u0438 SystemJS-importmap) \u0441 Vite-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0441 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 import\/export.<\/p>\n<h3>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0441 SystemJS \u043d\u0430 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 importmap<\/h3>\n<p>\u041c\u044b \u043c\u043e\u0433\u043b\u0438 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0432 \u043b\u043e\u0431: \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0431\u0430\u043d\u0434\u043b \u0432 \u043e\u0434\u0438\u043d JS-\u0444\u0430\u0439\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/rollupjs.org\/\">rollup<\/a> (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u0432 Vite) \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a SystemJS-\u043c\u043e\u0434\u0443\u043b\u044c. \u041d\u043e \u0442\u043e\u0433\u0434\u0430 \u043c\u044b \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0442\u043e\u0442 \u0436\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f, \u0447\u0442\u043e \u0438 \u0432 Webpack, \u043f\u043e\u0442\u0435\u0440\u044f\u0432 \u0432\u0441\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043d\u0430\u0448 appshell, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Webpack \u0438 \u0437\u0430\u0442\u043e\u0447\u0435\u043d \u043d\u0430 SystemJS, \u043d\u0430 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 importmap.<\/p>\n<p>\u041a\u0430\u043a \u0431\u044b\u043b\u043e \u0434\u043e:<\/p>\n<pre><code class=\"typescript\">import { LifeCycles, registerApplication, start } from 'single-spa'; import 'systemjs'; import 'import-map-overrides';  registerApplication(   `app`,   () => System.import&lt;LifeCycles>(app),   location => location.pathname.startsWith(\/), );    start(); <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u0441\u043b\u0435:<\/p>\n<pre><code class=\"typescript\">import { registerApplication, start } from 'single-spa'; import 'import-map-overrides';  registerApplication(   `app`,   \/\/ eslint-disable-next-line @typescript-eslint\/ban-ts-comment   \/\/ @ts-ignore   () => import(\/* webpackIgnore: true *\/ app),   location => location.pathname.startsWith(\/), );  start(); <\/code><\/pre>\n<p><em>webpackIgnore: true \u0434\u0430\u0451\u0442 Webpack \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0442 lazy-load \u0438 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u0434\u0441\u043f\u043b\u0438\u0442\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0435 \u043d\u0443\u0436\u043d\u043e. @ts-ignore, \u0447\u0442\u043e\u0431\u044b TypeScript \u043d\u0435 \u0440\u0443\u0433\u0430\u043b\u0441\u044f \u043d\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f app, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e importmap.<\/em><\/p>\n<p>\u0412 <code>index.html<\/code> \u0444\u0430\u0439\u043b\u0435 appshell \u043c\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u043b\u0438 \u0442\u0438\u043f importmap \u0441 SystemJS \u043d\u0430 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435.<\/p>\n<p>\u0414\u043e:<\/p>\n<pre><code class=\"xml\">&lt;meta name=\"importmap-type\" content=\"systemjs-importmap\" \/> &lt;import-map-overrides-full show-when-local-storage=\"devtools\">&lt;\/import-map-overrides-full> &lt;script type=\"systemjs-importmap\" src=\"&lt;http:\/\/cdn.dodois.dev\/importmap.json>\">&lt;\/script>  &lt;div id=\"single-spa-application:app\">&lt;\/div>  &lt;script defer=\"defer\" src=\"\/appshell.bundle.js\">&lt;\/script> <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435:<\/p>\n<pre><code class=\"xml\">&lt;meta name=\"importmap-type\" content=\"importmap\" \/> &lt;import-map-overrides-full show-when-local-storage=\"devtools\">&lt;\/import-map-overrides-full> &lt;script type=\"importmap\" src=\"&lt;http:\/\/cdn.dodois.dev\/importmap.json>\">&lt;\/script>  &lt;div id=\"single-spa-application:app\">&lt;\/div>  &lt;script type=\"module\" defer=\"defer\" src=\"\/appshell.bundle.js\">&lt;\/script> <\/code><\/pre>\n<p>\u0410 \u0435\u0449\u0451 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u043e\u043f\u0446\u0438\u044e <code>build.rollupOptions.output.format<\/code> \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>module<\/code>.<\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 external importmap<\/h3>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0445\u043e\u0442\u044c importmap \u0438 <a href=\"https:\/\/html.spec.whatwg.org\/multipage\/webappapis.html#import-maps\">\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 HTML<\/a>, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0433\u0440\u0443\u0441\u0442\u043d\u0430\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0432\u043e\u0435, \u0441 \u0447\u0435\u043c \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c, \u043e\u0442\u043a\u0440\u044b\u0432 Chrome, \u2014 <code>External import maps are not yet supported<\/code>. <a href=\"https:\/\/github.com\/WICG\/import-maps\/issues\/235\">\u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442<\/a>, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c importmap \u0447\u0435\u0440\u0435\u0437 <code>src<\/code> \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u043e\u043f\u0438\u0441\u0430\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u043b\u0430 \u0442\u0435\u0433\u0430 <code>script<\/code>. <\/p>\n<p>\u041e\u043a\u0435\u0439, \u0432 \u0442\u0435\u043e\u0440\u0438\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c importmap \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>fetch<\/code> \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 DOM. \u042d\u0442\u043e \u043d\u0430\u043c Chrome \u043d\u0435 \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442. \u0413\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b importmap \u0431\u044b\u043b\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u043c\u043e\u0434\u0443\u043b\u044f. \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u043f\u043e\u0441\u043b\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0445\u043e\u0442\u044f \u0431\u044b \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0451\u043c <code>script<\/code> \u0442\u0435\u0433 \u0447\u0435\u0440\u0435\u0437 JS, \u043d\u043e \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0431\u0435\u0437 <code>fetch<\/code>:<\/p>\n<pre><code class=\"xml\">&lt;script>   const im = document.createElement('script');   im.type = 'importmap';   im.textContent = JSON.stringify({     \"imports\": {       \"app\": \"&lt;http:\/\/cdn.dodois.dev\/singleSpa.js>\"     }   });   document.currentScript.after(im); &lt;\/script> <\/code><\/pre>\n<p><code>type<\/code><em> \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f \u0441 <\/em><code>importmap<\/code><em> \u043d\u0430 <\/em><code>overridable-importmap<\/code>.<\/p>\n<p>\u0418 \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e!<\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 importmap<\/h3>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c override \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0430\u043d\u0434\u043b, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443: <code>Multiple import maps are not yet supported.<\/code> \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432 \u0431\u0430\u0433\u0442\u0440\u0435\u043a\u0435\u0440\u0435 Chrome \u0443\u0436\u0435 \u0442\u0440\u0438 \u0433\u043e\u0434\u0430 <a href=\"https:\/\/crbug.com\/927119\">\u0432\u0438\u0441\u0438\u0442 issue<\/a> \u0441 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. \u0418, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0438\u0441\u043f\u0440\u0430\u0432\u044f\u0442 \u044d\u0442\u043e \u043d\u0435 \u0441\u043a\u043e\u0440\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 importmap \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f <a href=\"https:\/\/github.com\/WICG\/import-maps\/#multiple-import-map-support\">\u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/a>. \u0414\u043b\u044f \u043d\u0430\u0441 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u0443\u044e importmap \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e importmap \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0430\u043d\u0434\u043b.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 import-map-overrides <a href=\"https:\/\/github.com\/single-spa\/import-map-overrides\/blob\/main\/docs\/configuration.md#client-side-single-map\">\u044d\u0442\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438<\/a>. \u041f\u043e \u0441\u0443\u0442\u0438, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u0438 \u043e\u0434\u043d\u0430 importmap, \u0430 import-map-overrides \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u0435\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u00ab\u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0443\u00bb \u0441 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439. \u041f\u043e \u0438\u0442\u043e\u0433\u0443 \u043a\u043e\u0434 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f:<\/p>\n<pre><code class=\"xml\">&lt;script>   const im = document.createElement('script');   im.type = 'overridable-importmap';   im.textContent = JSON.stringify({     \"imports\": {       \"app\": \"&lt;http:\/\/cdn.dodois.dev\/singleSpa.js>\"     }   });   document.currentScript.after(im); &lt;\/script> <\/code><\/pre>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 hot reload<\/h3>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f importmap \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 <code>Uncaught Error: application 'app' died in status LOADING_SOURCE_CODE: @vitejs\/plugin-react can't detect preamble. Something is wrong.<\/code><\/p>\n<p>\u042d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043d\u0430\u0448 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0430\u043d\u0434\u043b \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c\u0443 dev-\u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b hot module replacement. \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0442\u0430\u043a\u0436\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u043f\u043e\u0442\u043e\u043c. \u041f\u043e\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b\u0438 HMR \u0432 vite.config \u0434\u043b\u044f React-\u043f\u043b\u0430\u0433\u0438\u043d\u0430:<\/p>\n<pre><code class=\"typescript\">const options: Options = mode === `dev-single-spa` ? { exclude: \/.*\/,   } : {} \/\/ ... plugins: [react(options)], <\/code><\/pre>\n<h3>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 importmap \u0441 \u0431\u044d\u043a\u0430<\/h3>\n<p>\u0421\u043d\u043e\u0432\u0430 \u0432\u0441\u0451 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0442\u0435\u0445\u0434\u043e\u043b\u0433, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c importmap \u0441 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e cdn \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e fetch:<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0432 HTML appshell:<\/p>\n<pre><code class=\"typescript\">const im = document.createElement('script'); im.type = 'overridable-importmap';  const loadImportmap = async () => {   const result = await fetch(`http:\/\/cdn.dodois.dev\/importmap.json>`);                    const importmap = await result.json();    im.textContent = JSON.stringify(importmap);    document.currentScript.after(im); }  loadImportmap(); <\/code><\/pre>\n<h3>\u041f\u0440\u043e\u0431\u043b<\/h><\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-393938","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/393938","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=393938"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/393938\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=393938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=393938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=393938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}