{"id":413708,"date":"2024-06-29T23:17:27","date_gmt":"2024-06-29T23:17:27","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=413708"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=413708","title":{"rendered":"<span>Angular Libs \u043a\u0430\u043a \u043c\u043e\u043d\u043e\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 2: tree shaking \u0438 \u0441\u0431\u043e\u0440\u043a\u0430 \u043a\u043b\u043e\u043d\u043e\u0432<\/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<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0412 <a href=\"https:\/\/habr.com\/ru\/company\/karuna\/blog\/588448\/\"><u>\u043f\u0440\u043e\u0448\u043b\u043e\u043c \u043f\u043e\u0441\u0442\u0435<\/u><\/a> \u043c\u044b \u0441 \u0432\u0430\u043c\u0438 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Angular libs, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0443 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c \u0438 \u0434\u0430\u0436\u0435 \u0432\u044b\u043d\u0435\u0441\u043b\u0438 \u043d\u0430\u0448\u0438 \u0430\u0441\u0441\u0435\u0442\u044b \u0432 \u043e\u0434\u043d\u0443 \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u0445\u043e\u0447\u0443 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0442\u0435\u043c\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438, \u043a\u0430\u043a \u0430\u043f\u043e\u0444\u0435\u043e\u0437, \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0441\u0431\u043e\u0440\u043a\u0435 \u0434\u0432\u0443\u0445, \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0412 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u041a\u0430\u0440\u0443\u043d\u044b \u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0447\u0435\u043c\u0443 \u0434\u0430\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0434 \u0441\u0435\u0431\u044f, \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u044f \u0447\u0443\u0436\u0443\u044e \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443.\u00a0<\/p>\n<p><strong>\u0412 \u0445\u043e\u0434\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u043c\u0438 <\/strong><a href=\"https:\/\/gitlab.com\/angular-libs-examples\/example-2\"><strong><u>\u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/u><\/strong><\/a><strong> \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430 \u043c\u044b \u0441 \u0432\u0430\u043c\u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c:<\/strong>\u00a0<\/p>\n<ul>\n<li>\n<p>\u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c tree shaking \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a;<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c core-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u0436\u043d\u0430 \u0432\u0435\u0437\u0434\u0435;<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0432\u0430 \u043a\u043b\u043e\u043d\u0430 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043d\u043e \u0441 \u0440\u0430\u0437\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/749\/af0\/809\/749af0809d0b8fa132c5aae2b26fe88a.jpeg\" alt=\"\" title=\"\" width=\"1280\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/749\/af0\/809\/749af0809d0b8fa132c5aae2b26fe88a.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h3>\n<ol>\n<li>\n<p><a href=\"#tree-shaking\">Tree Shaking \u0438\u043b\u0438 \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u0434\u0430.<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#core\">&#171;\u041e\u0441\u043d\u043e\u0432\u044b \u043e\u0441\u043d\u043e\u0432&#187; (\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0435\u0434\u0438\u043d\u043e\u0439 core-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438).<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#clones\">\u0421\u0431\u043e\u0440\u043a\u0430 \u0434\u0432\u0443\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438 lazy loading.<\/a><\/p>\n<\/li>\n<\/ol>\n<h2>Tree Shaking \u0438\u043b\u0438 \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u0434\u0430<\/h2>\n<p><a class=\"anchor\" name=\"tree-shaking\" id=\"tree-shaking\"><\/a><\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043c\u044b \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043d\u043e\u0432\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441 \u043d\u0438\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u201c\u0432\u0441\u0442\u0440\u044f\u0445\u0438\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u0430\u201d. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u0442\u0432\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u2014 \u043d\u0438\u043a\u0430\u043a. Tree shaking \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438: \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043b\u0438\u0431\u0443, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u0442\u043e \u0432\u0441\u044f \u043e\u043d\u0430 \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0431\u0430\u043d\u0434\u043b. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0448 \u0441\u0431\u043e\u0440\u0449\u0438\u043a <strong>ng-packagr <\/strong>\u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 \u043e\u0431\u0449\u0438\u0439 \u0447\u0430\u043d\u043a, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u0443\u0441\u043e\u0447\u043a\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435\u0432\u043e\u043b\u044c\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0441\u0451. \u041f\u0435\u0447\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u043d\u0435 \u0441\u043f\u0435\u0448\u0438\u0442\u0435 \u0443\u043d\u044b\u0432\u0430\u0442\u044c! \u0415\u0441\u0442\u044c \u0432\u0435\u0441\u044c\u043c\u0430 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u043f\u0440\u0430\u0432\u0434\u0430, \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0442\u043e\u0442 \u0436\u0435 <strong>ng-packagr, <\/strong>\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 <a href=\"https:\/\/github.com\/ng-packagr\/ng-packagr\/blob\/master\/docs\/secondary-entrypoints.md\"><u>sub-entries<\/u><\/a> \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0415\u0441\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e, \u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0447\u0430\u043d\u043a, \u0438 \u0443\u0436\u0435 \u044d\u0442\u0438 \u0447\u0430\u043d\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 tree shaking \u0438 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u044b. \u0417\u0430 \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0444\u0430\u0439\u043b\u044b <strong>public-api.ts<\/strong> \u0438 <strong>package.json, <\/strong>\u043e\u043d\u0438 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u0435\u0449\u0451 \u0438 \u0432 \u043c\u043e\u0434\u0443\u043b\u0438. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443:<\/p>\n<pre><code>some-lib \u251c\u2500\u2500 src |  \u2514\u2500\u2500 lib |\u251c\u2500\u2500 sub-entry-a ||  \u251c\u2500\u2500 *.ts ||  \u251c\u2500\u2500 index.ts ||  \u251c\u2500\u2500 package.json ||  \u2514\u2500\u2500 public-api.ts |\u251c\u2500\u2500 sub-entry-b ||  \u251c\u2500\u2500 *.ts ||  \u251c\u2500\u2500 index.ts ||  \u251c\u2500\u2500 package.json ||  \u2514\u2500\u2500 public-api.ts |\u251c\u2500\u2500 sub-entry-* |\u2514\u2500\u2500 public-api.ts \u2514\u2500\u2500 package.json<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0439\u0434\u0451\u043c\u0441\u044f \u043f\u043e \u043d\u0435\u0439.<\/p>\n<p><strong>some-lib\/src\/public-api.ts \u2014 <\/strong>\u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0432\u0441\u0451 \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0432\u0441\u0435\u0445 \u043d\u0430\u0448\u0438\u0445 sub-entries \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0437\u0430 \u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0439 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 \u2014<strong> import { any } from &#8216;some-lib&#8217;<\/strong>.<\/p>\n<p><strong>some-lib\/src\/lib\/sub-entry-* \u2014 <\/strong>\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430\u043a\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0447\u0430\u043d\u043a.<\/p>\n<p><strong>some-lib\/src\/lib\/sub-entry-a\/public-api.ts \u2014 <\/strong>\u0444\u0430\u0439\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u0432\u0441\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043a \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0447\u0430\u043d\u043a\u0443 \u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<p><strong>some-lib\/src\/lib\/sub-entry-a\/index.ts \u2014 <\/strong>\u0442\u0443\u0442 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u0451 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u0448\u0435. \u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u043e\u0442 \u0438\u043d\u0434\u0435\u043a\u0441\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 <strong>some-lib\/src\/public-api.ts.<\/strong><\/p>\n<p><strong>some-lib\/src\/lib\/sub-entry-a\/package.json \u2014 <\/strong>\u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c ng-packagr \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0447\u0430\u043d\u043a\u0438. \u0412\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u0430\u0448 <strong>some-lib\/src\/lib\/sub-entry-a\/public-api.ts.<\/strong><\/p>\n<p>\u041a\u0430\u043a \u0432\u044b \u0443\u0436\u0435 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c, <strong>some-lib\/src\/lib\/sub-entry-a\/index.ts <\/strong>\u0438 <strong>some-lib\/src\/lib\/sub-entry-a\/package.json <\/strong>\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f, \u0438 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u0447\u0430\u043d\u043a\u0430 \u0432 \u0447\u0430\u043d\u043a.<\/p>\n<h4>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e sub-entry \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043a\u0430\u0445. <\/h4>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/034\/7c9\/aab\/0347c9aab2e4d82f3fc34b628c817e36.png\" width=\"697\" height=\"700\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/034\/7c9\/aab\/0347c9aab2e4d82f3fc34b628c817e36.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0447\u0430\u043d\u043a \u0432 \u0434\u0440\u0443\u0433\u043e\u043c. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u043f\u0443\u0442\u0438 \u043f\u0440\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0443 \u0432\u0430\u0441 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0438 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0443\u0442\u0438 \u0441 <code>..\/..\/<\/code>, \u043e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<blockquote>\n<p><em>ERROR: Unable to write a reference to SomeComponent in example-path\/some-lib\/src\/lib\/sub-entry-a\/some.component.ts from example-path\/some-lib\/src\/lib\/sub-entry-a\/some.module.ts<\/em><\/p>\n<\/blockquote>\n<p>\u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043e\u0434\u043d\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c: sub-entry \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0443\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u044f\u0442 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u0435\u0433\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0412\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u044b \u0432\u0441\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0440\u0430\u0437\u0443 \u0438\u0437 <code>some-lib<\/code>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <strong>import { any } from &#8216;some-lib&#8217;<\/strong>, \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u043f\u0443\u0442\u0438 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0434\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"javascript\">import { SomeModule } from 'some-lib\/src\/lib\/sub-entry-a';<\/code><\/pre>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441 <strong>tsconfig.lib.json<\/strong> \u2014 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0430\u043b\u0438\u0430\u0441 \u0434\u043b\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a:<\/p>\n<details class=\"spoiler\">\n<summary>ui-lib-example\/tsconfig.lib.json<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"json\">\"paths\": {    \"assets-library\/*\": [      \"dist\/assets-library\/*\",      \"dist\/assets-library\"    ],    \"assets-library\": [      \"dist\/assets-library\/*\",      \"dist\/assets-library\"    ],    \"ui-lib-example\/*\": [      \"libs\/ui-lib-example\/*\",      \"libs\/ui-lib-example\"    ],    \"ui-lib-example\": [      \"libs\/ui-lib-example\/*\",      \"libs\/ui-lib-example\"    ] }<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0410 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0430\u043b\u0438\u0430\u0441\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432<strong> tsconfig.json.<\/strong><\/p>\n<details class=\"spoiler\">\n<summary>tsconfig.json<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"json\">\"paths\": {    \"assets-library\/*\": [      \"dist\/assets-library\/*\",      \"dist\/assets-library\"    ],    \"assets-library\": [      \"dist\/assets-library\/*\"      \"dist\/assets-library\"    ],    \"ui-lib-example\/*\": [      \"dist\/ui-lib-example\/*\",      \"dist\/ui-lib-example\"    ],    \"ui-lib-example\": [      \"dist\/ui-lib-example\/*\",      \"dist\/ui-lib-example\"    ] }<\/code><\/pre>\n<\/div>\n<\/details>\n<p><strong>\u0422\u0430\u043a\u0436\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0443 \u043e\u0448\u0438\u0431\u043a\u0443, <\/strong>\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0443\u044e \u0441 <strong>rootDir<\/strong>. \u0412\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<blockquote>\n<p><em>Error File <\/em><code>sub-entry-a\/some.service.ts<\/code><em> is not under &#8216;rootDir&#8217; <\/em><code>sub-entry-b<\/code><em>. <\/em><code>rootDir<\/code><em> is expected to contain all source files.<\/em><\/p>\n<\/blockquote>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c \u0436\u0435, \u0447\u0442\u043e \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0443\u043d\u043a\u0442\u0435: \u0438\u0437 sub-entry \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u0443\u0442\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041d\u0443 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432\u044b\u0448\u0435: \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u0441\u0432\u043e\u0439 \u0447\u0430\u043d\u043a, \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0451 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c.<\/p>\n<p>\u0412 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u0434\u0430, \u043e\u0434\u043d\u0430\u043a\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u0432\u0435\u0441\u043e\u043c\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u044d\u0442\u043e \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u0443\u0441\u043a\u0430 \u043a\u043e\u0434\u0430 \u043d\u0430 \u043c\u0435\u043b\u043a\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 tree shaking, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 sub-entries \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 &#171;\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u0439&#187; \u0432\u044b\u0432\u043e\u0434 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0435 \u0434\u0430\u0434\u0443\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435. \u0410 \u0432\u043e\u0442 \u0435\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0438 \u043e\u0434\u0438\u043d \u043e\u0431\u0449\u0438\u0439 \u0447\u0430\u043d\u043a, \u0442\u043e ng-packagr \u043d\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u0431\u044b \u043d\u0430 \u044d\u0442\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f.<\/p>\n<blockquote>\n<p><em>\u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0438\u043a\u043e\u043d\u043a\u0430\u043c\u0438 \u0432\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <\/em><strong><em>svg-icon,\u00a0 <\/em><\/strong><em>\u0442\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 <\/em><strong><em>svg-icons.ts, <\/em><\/strong><em>\u0442\u0435\u043f\u0435\u0440\u044c \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u0432 \u043c\u043e\u0434\u0443\u043b\u044c <\/em><strong><em>icons. <\/em><\/strong><em>\u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 \u0438\u043a\u043e\u043d\u043e\u043a, \u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0447\u0430\u043d\u043a\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/em><\/p>\n<\/blockquote>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0447\u0430\u043d\u043a\u043e\u0432 \u0432 \u0431\u0438\u043b\u0434\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0434\u043d\u043e\u0433\u043e.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/168\/604\/572\/168604572efd2626addf949f1cc52399.png\" alt=\"\" title=\"\" width=\"992\" height=\"546\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/168\/604\/572\/168604572efd2626addf949f1cc52399.png\"\/><figcaption><\/figcaption><\/figure>\n<p><a href=\"https:\/\/gitlab.com\/angular-libs-examples\/example-2\/-\/commit\/77d7dfb1ddcd940935d8115d07c06f0f593647fc\"><strong><u>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043a\u043e\u043c\u043c\u0438\u0442<\/u><\/strong><\/a><\/p>\n<h2>\u201c\u041e\u0441\u043d\u043e\u0432\u044b \u043e\u0441\u043d\u043e\u0432\u201d<\/h2>\n<p><a class=\"anchor\" name=\"core\" id=\"core\"><\/a><\/p>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 tree shaking \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430\u0448\u0443 <strong>core-library<\/strong>. \u0423\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Angular \u0432\u044b \u043b\u0438\u0431\u043e \u0447\u0430\u0441\u0442\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0435 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, CommonModule), \u043b\u0438\u0431\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u043d\u0435\u043a\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u044f \u0432\u0441\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0432 \u0438\u043c\u043f\u043e\u0440\u0442\u0430\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0435 \u0432\u0435\u0437\u0434\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0433\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0442\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438.\u00a0<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u043a\u0438\u0439 <code>CoreModule<\/code> \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u043e \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0438\u043c\u043f\u043e\u0440\u0442 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u043e \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u043c\u0435\u0440\u0435 \u0441\u0442\u0440\u0430\u043d\u043d\u043e. \u0410 \u0435\u0441\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0438 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435, \u0442\u043e \u043f\u043e\u043c\u0438\u043c\u043e \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043c\u044b \u0435\u0449\u0451 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u0441\u0443\u0442\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0438\u043b\u0434\u0430, \u0430 \u043e\u043d\u043e \u043d\u0430\u043c \u043d\u0430\u0434\u043e? \u042f\u0432\u043d\u043e \u043d\u0435 \u0440\u0430\u0434\u0438 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0440\u044f\u0441\u043a\u043e\u0439 \u0434\u0435\u0440\u0435\u0432\u0430.\u00a0<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043f\u043e\u043b\u043d\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0435\u0439 \u0432 \u0441\u0435\u0431\u044f \u044d\u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 <code>CoreModule<\/code> \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0451 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u0438, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0435 \u0437\u0430 \u0432\u0430\u0436\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a api. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u044d\u0442\u0438\u043c \u0438 \u0437\u0430\u0439\u043c\u0451\u043c\u0441\u044f. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u044f <code>CommonModule<\/code> \u0438\u0437 Angular \u0438, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, <code>FormsModule<\/code>.<\/p>\n<blockquote>\n<p><strong><em>\u0410\u0445\u0442\u0443\u043d\u0433!<\/em><\/strong><em> \u042d\u0442\u043e \u2014 \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u0434\u0440\u0430\u0436\u0430\u043d\u0438\u044f, \u0430 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430. \u041f\u043e\u0434\u0445\u043e\u0434\u0438\u0442\u0435 \u0441 \u0443\u043c\u043e\u043c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0442\u0430\u043a\u043e\u0433\u043e CoreModule \u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435, \u0432\u0435\u0437\u0434\u0435 \u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043f\u043e\u043c\u0435\u0449\u0451\u043d\u043d\u044b\u0435 \u0432 \u043d\u0435\u0433\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0438!<\/em><\/p>\n<\/blockquote>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 cli \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043d\u0451\u043c \u0432\u0441\u0435 \u0442\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438, \u0447\u0442\u043e \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0443\u043d\u043a\u0442\u0435. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6f8\/84d\/866\/6f884d866081facdc9b663a132b66676.png\" width=\"984\" height=\"726\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6f8\/84d\/866\/6f884d866081facdc9b663a132b66676.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u043d\u043f\u0443\u0442 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 \u0432 <strong>ui-lib-example.component.html.<\/strong><\/p>\n<details class=\"spoiler\">\n<summary>ui-lib-example.component.html<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"xml\">&lt;div *ngIf=\"true\">   &lt;form [formGroup]=\"form\">     &lt;input type=\"text\" formControlName=\"name\"\/>   &lt;\/form> &lt;\/div><\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0410 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c<strong> ui-lib-example.component.ts.<\/strong><\/p>\n<details class=\"spoiler\">\n<summary>ui-lib-example.component.ts<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">@Component({   selector: 'lib-ui-lib-example',   templateUrl: '.\/ui-lib-example.component.html',   styleUrls: ['.\/ui-lib-example.component.scss'],   changeDetection: ChangeDetectionStrategy.OnPush, }) export class UiLibExampleComponent {   form: FormGroup;    private name = 'Ricardo Milos';    constructor(private fb: FormBuilder) {     this.form = this.fb.group({       name: [this.name, Validators.required],     });   } }<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0443, \u0442\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443 <strong>&#171;NG0303: Can&#8217;t bind to &#8216;ngIf&#8217; since it isn&#8217;t a known property of &#8216;div&#8217;.&#187; <\/strong>, \u0430 \u0441 \u0444\u043e\u0440\u043c\u043e\u0439 \u0443 \u043d\u0430\u0441 \u0443\u043f\u0430\u0434\u0435\u0442 \u0431\u0438\u043b\u0434 <strong>ui-lib-example.<\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/429\/b05\/221\/429b0522125e628baec2daf9aeca2638.png\" width=\"2916\" height=\"768\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/429\/b05\/221\/429b0522125e628baec2daf9aeca2638.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432 <strong>ui-lib-example.module.ts <\/strong>\u043d\u0430\u0448<strong> <\/strong><code>CommonLibraryModule<\/code>,<strong> <\/strong>\u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c <strong>core-library<\/strong>. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 <code>CUSTOM_ELEMENT_SCHEMA<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c <code>CommonModule<\/code> Angular \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u044d\u0442\u043e \u0437\u0430 \u0442\u0435\u0433 \u0442\u0430\u043a\u043e\u0439 &#8212; <code>&lt;svg-icon><\/code>.<\/p>\n<details class=\"spoiler\">\n<summary>ui-lib-example.module.ts<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">import { CommonLibraryModule } from 'core-library';  @NgModule({   declarations: [     UiLibExampleComponent,   ],   imports: [     CommonLibraryModule,     IconsLibraryModule,   ],   exports: [     UiLibExampleComponent,   ],   schemas: [CUSTOM_ELEMENTS_SCHEMA] }) export class UiLibExampleModule { }<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c<strong> paths <\/strong>\u0434\u043b\u044f<strong> core-library <\/strong>\u0432<strong> angular-libs-examples\/libs\/ui-lib-example\/tsconfig.lib.json.<\/strong><\/p>\n<details class=\"spoiler\">\n<summary>ui-lib-example\/tsconfig.lib.json<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"json\">\"core-library\/*\": [   \"libs\/core-library\/*\",   \"libs\/core-library\" ], \"core-library\": [   \"libs\/core-library\/*\",   \"libs\/core-library\" ]<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 <strong>ui-lib-example <\/strong>(\u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u043d\u0435\u0435 \u0434\u043e\u043f\u0438\u0441\u0430\u043b\u0438 paths \u0438 \u0431\u0438\u043b\u0434\u0438\u043b\u0438 \u0441 \u0444\u043b\u0430\u0433\u043e\u043c &#8212;watch, \u0442\u043e \u0443 \u0432\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u043e \u0437\u0430\u0432\u0435\u0441\u0442\u0438\u0442\u044c \u0438 \u0431\u0435\u0437 \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0430). \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043e\u043a, \u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0430\u0448\u0430 \u0444\u043e\u0440\u043c\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4f8\/e78\/693\/4f8e7869308b403a27f33b0a29534627.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435\" width=\"960\" height=\"892\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4f8\/e78\/693\/4f8e7869308b403a27f33b0a29534627.png\"\/><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435<\/figcaption><\/figure>\n<p><a href=\"https:\/\/gitlab.com\/angular-libs-examples\/example-2\/-\/commit\/442b42f64cc3883af289a3698e07e61b170d76fe\"><strong><u>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043a\u043e\u043c\u0438\u0442<\/u><\/strong><\/a><\/p>\n<p>\u041d\u0443 \u043b\u0430\u0434\u043d\u043e, \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 Angular \u0432\u0441\u0451 \u0431\u044b\u043b\u043e \u0438 \u0442\u0430\u043a \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0430 \u0447\u0442\u043e \u043d\u0430\u0441\u0447\u0451\u0442 \u043d\u0430\u0448\u0438\u0445 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439? \u0414\u043b\u044f \u043d\u0438\u0445 \u0431\u0443\u0434\u0443\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u0435 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u0447\u0442\u043e \u0438 \u0434\u043b\u044f <code>CommonLibraryModule<\/code>. \u0422\u043e \u0435\u0441\u0442\u044c, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0435\u0434\u0438\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0438\u043d\u0430\u0447\u0435 \u0440\u0438\u0441\u043a\u0443\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u043c \u0431\u0438\u043b\u0434\u0435.<\/p>\n<p>\u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e, \u043a\u0430\u043a \u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u0432\u044b\u0448\u0435, \u044d\u0442\u043e \u0432\u044b\u043d\u043e\u0441\u0438\u0442\u044c \u0432 <strong>core-library<\/strong>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c <strong>api.service<\/strong>, \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0449\u0438\u0439 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 API, \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043b\u044d\u0439\u0430\u0443\u0442\u0430\u043c\u0438 (\u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043a\u043d\u0430, \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438), \u0441\u0430\u043c\u0438 \u043b\u044d\u0439\u0430\u0443\u0442\u044b (\u043e\u0441\u043d\u043e\u0432\u044b \u0434\u043b\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u0441\u0430\u0439\u0434\u0431\u0430\u0440\u044b, \u0445\u0435\u0434\u0435\u0440\u044b) \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0432\u0435\u0449\u0438.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u0430\u043a \u0440\u0430\u0437 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 api. \u0422\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u0440\u0435\u043d\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <strong>proxy.conf.js<\/strong><\/p>\n<details class=\"spoiler\">\n<summary>proxy.conf.js<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">\/\/ \u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u043c, \u0441 \u043a\u0430\u043a\u0438\u0445 \u0443\u0440\u043b\u043e\u0432 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 const PROXY_URLS = [   '\/api.test\/*', ];  \/\/ \u041e\u043f\u0438\u0448\u0435\u043c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 const PROXY_CONFIG = {   target: 'https:\/\/slack.com\/api',   changeOrigin: true,   secure: false,   logLevel: 'debug', }  module.exports = {   ...PROXY_URLS.reduce(     (proxies, url) =>       Object.assign(proxies, {         [url]: PROXY_CONFIG,       }),     {},   ), };<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0410 \u0442\u0430\u043a\u0436\u0435 \u0441\u0442\u0440\u043e\u043a\u0443 <code>\"proxyConfig\": \"proxy.conf.js\"<\/code> \u0432 \u0440\u0430\u0437\u0434\u0435\u043b <strong>serve <\/strong>\u0432<strong> angular.json<\/strong>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e91\/959\/d42\/e91959d42bf0b4407d9a2e7fb6770e70.png\" width=\"1404\" height=\"548\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e91\/959\/d42\/e91959d42bf0b4407d9a2e7fb6770e70.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0448<strong> <\/strong><code>ApiModule<\/code><strong> <\/strong>\u0432\u043c\u0435\u0441\u0442\u0435 \u0441<strong> <\/strong><code>ApiService<\/code><strong>. <\/strong>\u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0442\u0443\u0442 \u0432\u0435\u0441\u044c \u043a\u043e\u0434, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0445 \u0441\u0440\u0430\u0437\u0443 \u0432 <a href=\"https:\/\/gitlab.com\/angular-libs-examples\/example-2\/-\/commit\/ed008146ff233753b2cde7bbe86154007a718996\"><u>\u043a\u043e\u043c\u043c\u0438\u0442\u0435<\/u><\/a> \u0438\u043b\u0438 <a href=\"https:\/\/gitlab.com\/angular-libs-examples\/example-2\/-\/tree\/main\"><u>\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/u><\/a>.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0438 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445. \u041d\u0443\u0436\u043d\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <strong>ApiModule <\/strong>\u0432 \u0438\u043c\u043f\u043e\u0440\u0442\u044b AppModule, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b <strong>test.service.ts <\/strong>\u043a <strong>app.module.ts <\/strong>\u0438 \u043a <strong>ui-lib-example.module.ts<\/strong><\/p>\n<details class=\"spoiler\">\n<summary>test.service.ts<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">import { Injectable } from '@angular\/core';  import { Observable } from 'rxjs';  import { ApiService, Query } from 'core-library';  @Injectable() export class TestService {   private readonly query: Query;    constructor(private api: ApiService) {     this.query = this.api.query(\u2018api.test\u2019);   }    getTest(): Observable&lt;any> {     return this.query('');   } }<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 <code>providers<\/code> \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434<strong> <\/strong><code>getTest<\/code><strong> <\/strong>\u043d\u0430 \u0445\u0443\u043a\u0435<strong> <\/strong><code>OnInit<\/code><strong>.<\/strong><\/p>\n<pre><code class=\"javascript\">ngOnInit(): void {     this.service.getTest().pipe(take(1))       .subscribe(res => console.log('Result\u2019, res)); }<\/code><\/pre>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u0442\u044c ui-lib-example \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c yarn start. \u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/24b\/704\/53a\/24b70453a2d263188ce237d990ed57b7.png\" width=\"1506\" height=\"572\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/24b\/704\/53a\/24b70453a2d263188ce237d990ed57b7.png\"\/><figcaption><\/figcaption><\/figure>\n<p><strong>\u0412\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0430 \u0432\u044b \u0441\u043d\u043e\u0432\u0430 \u0432\u043e\u0441\u0445\u0438\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u044b!<\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/379\/e17\/a00\/379e17a0000b2163c8a65d0a01990431.jpeg\" width=\"768\" height=\"385\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/379\/e17\/a00\/379e17a0000b2163c8a65d0a01990431.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p><a href=\"https:\/\/gitlab.com\/angular-libs-examples\/example-2\/-\/commit\/2a8242351f17c4d50394f4ac5bed19321ae31bf8\"><strong><u>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043a\u043e\u043c\u043c\u0438\u0442<\/u><\/strong><\/a><\/p>\n<h2>\u0421\u0431\u043e\u0440\u043a\u0430 \u0434\u0432\u0443\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438 lazy loading<\/h2>\n<p><a class=\"anchor\" name=\"clones\" id=\"clones\"><\/a><\/p>\n<p>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0434\u043e\u0432\u0435\u0441\u0442\u0438 \u0434\u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u043e\u043d\u043e\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0432\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 lazy-loading \u043d\u0430 \u0440\u043e\u0443\u0442\u0435\u0440\u0435.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0430\u043f\u043a\u0438 <strong>app <\/strong>\u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0432 \u043d\u0435\u0439 \u0445\u0440\u0430\u043d\u0438\u043b\u043e\u0441\u044c \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0447\u0435\u043c \u0441\u0435\u0439\u0447\u0430\u0441. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u043f\u0430\u043f\u043a\u0430\u043c\u0438 <strong>app <\/strong>\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438<strong>, <\/strong>\u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u043e\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 <strong>proxy.conf, <\/strong>\u0441\u0435\u0440\u0432\u0438\u0441 \u0432\u043e\u0440\u043a\u0435\u0440\u044b, \u043b\u0438\u043d\u0442\u0435\u0440\u044b \u0438 \u0442.\u0434., \u043d\u043e \u0443 \u043d\u0430\u0441 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0449\u0438\u0435. \u041d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e <strong>tsconfig <\/strong>\u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0432\u043e\u0439 \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435<strong> main.ts <\/strong>\u0438<strong> polyfill.ts.<\/strong><\/p>\n<pre><code class=\"json\">{   \"extends\": \"..\/..\/..\/tsconfig.json\",   \"files\": [     \".\/polyfills.ts\",     \".\/main.ts\"   ], }<\/code><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0442\u0430\u043a\u043e\u0433\u043e, \u0433\u0434\u0435 <strong>first-app<\/strong> \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043c\u0443\u0447\u0430\u043b\u0438 \u0432\u0441\u0435 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f, \u0430 <strong>second-app<\/strong> \u2014 \u043d\u043e\u0432\u043e\u0435, \u0441 \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u043c <code>UiLibExampleComponent<\/code><strong> <\/strong>\u0438 \u0435\u0449\u0451 \u043e\u0434\u043d\u0438\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f9c\/4ab\/a6f\/f9c4aba6fd0fc05ca443e14227452a6c.png\" width=\"838\" height=\"1328\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f9c\/4ab\/a6f\/f9c4aba6fd0fc05ca443e14227452a6c.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e cli, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c <code>angular.json<\/code>, \u0442\u043e \u0432 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u2014 \u044d\u0442\u043e \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0430 \u0440\u0443\u0442\u043e\u0432\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442. \u041e\u0434\u043d\u0430\u043a\u043e, \u0432\u0430\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430\u0448 <code>angular.json<\/code>, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u0435\u0440\u0435\u0435\u0445\u0430\u043b\u043e \u043e\u0434\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043d\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u0442\u043e\u0440\u043e\u043c. \u0414\u0443\u043c\u0430\u044e, \u0438\u0437-\u0437\u0430 \u043e\u0431\u044a\u0451\u043c\u0430 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0442\u0443\u0442 \u0432\u0435\u0441\u044c \u043a\u043e\u0434, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u043e\u0442 \u0432\u0430\u043c <a href=\"https:\/\/gitlab.com\/angular-libs-examples\/example-2\/-\/commit\/1cb6f0bf8e4cd8474cefd465b8e55c231776ff4d\"><u>\u043a\u043e\u043c\u043c\u0438\u0442<\/u><\/a> \u0441 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u0432\u0441\u0435\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>yarn build &lt;project_name><\/code> \u0438 <code>yarn start &lt;project_name><\/code><strong> <\/strong>\u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0451 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/06d\/661\/2a7\/06d6612a7db8a34343ff4217a6fa9f6b.png\" width=\"1486\" height=\"884\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/06d\/661\/2a7\/06d6612a7db8a34343ff4217a6fa9f6b.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0439\u043c\u0451\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f second-app. \u0423\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0442\u0443\u0442 \u0443 \u0432\u0430\u0441 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0432\u0430\u043c <a href=\"https:\/\/gitlab.com\/angular-libs-examples\/example-2\/-\/commit\/e31effac3c7a49b5b56a0a9a340c6ec31ab42e0f\"><u>\u043a\u043e\u043c\u043c\u0438\u0442<\/u><\/a>. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0443\u0434\u0430 \u043e\u0434\u0438\u043d \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430. \u0418 \u0437\u0430\u0439\u043c\u0451\u043c\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 lazy-loading \u0432 second-app.\u00a0<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 <code>TestModule<\/code>, \u043e\u043d \u043a\u0430\u043a \u0440\u0430\u0437 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u201c\u043b\u0435\u043d\u0438\u0432\u043e\u201d. \u0418 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432 \u043d\u0435\u0433\u043e <code>SecondAppLibraryModule<\/code><strong>,<\/strong> \u0430 <code>UiLibExampleModule<\/code><strong> <\/strong>\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432 <code>AppModule<\/code><strong>. <\/strong>\u0428\u0430\u0431\u043b\u043e\u043d\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"xml\">&lt;!--App.component.html--> &lt;lib-ui-lib-example>&lt;\/lib-ui-lib-example> &lt;router-outlet>&lt;\/router-outlet>  &lt;!--Test.component.html--> &lt;lib-second-app-library>&lt;\/lib-second-app-library><\/code><\/pre>\n<p>\u0421\u0430\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c lazy-loading \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c\u043e\u0439 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0451\u043c \u043d\u0435 \u0431\u0443\u0434\u0443, \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044e <a href=\"https:\/\/gitlab.com\/angular-libs-examples\/example-2\/-\/commit\/ca193a750ab201cbaf917d3772a810b91c1c29de\"><u>\u043a\u043e\u043c\u043c\u0438\u0442<\/u><\/a> \u043d\u0430 \u043d\u0435\u0433\u043e. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0433\u0434\u0435 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a-\u0434\u043e\u043c\u0435\u043d\u043e\u0432, \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432 \u043b\u0435\u043d\u0438\u0432\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/219\/e15\/c04\/219e15c0442ab1b9a75d08efddf39786.png\" width=\"838\" height=\"876\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/219\/e15\/c04\/219e15c0442ab1b9a75d08efddf39786.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u043b\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 <em>source<\/em> \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043c\u044b \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u043c \u043b\u0438\u0448\u043d\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6f9\/97b\/d86\/6f997bd86af1872d79cab647e4954b62.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435\" width=\"1198\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6f9\/97b\/d86\/6f997bd86af1872d79cab647e4954b62.png\"\/><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435<\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f7c\/bce\/dde\/f7cbcedde38a5ed03ffc7255802589df.png\" alt=\"\u0427\u0442\u043e \u0432\u0438\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438\" title=\"\u0427\u0442\u043e \u0432\u0438\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438\" width=\"716\" height=\"628\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f7c\/bce\/dde\/f7cbcedde38a5ed03ffc7255802589df.png\"\/><figcaption>\u0427\u0442\u043e \u0432\u0438\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438<\/figcaption><\/figure>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 <strong>\u2018\/test\u2019, <\/strong>\u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>second-app-library<\/strong>, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 source \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043d\u0430\u0448 lazy module.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e36\/2f5\/093\/e362f509310231bd9de257869a79fef4.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435\" width=\"970\" height=\"658\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e36\/2f5\/093\/e362f509310231bd9de257869a79fef4.png\"\/><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435<\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/99b\/1ca\/8fe\/99b1ca8fe5cfb6fd1887a85bb63fc386.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438\" width=\"712\" height=\"640\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/99b\/1ca\/8fe\/99b1ca8fe5cfb6fd1887a85bb63fc386.png\"\/><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438<\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0431\u0438\u043b\u0434\u0438\u0442\u044c \u0432\u0441\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u043e \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <strong>dist<\/strong> \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/639\/3b8\/5d2\/6393b85d2e92f6114e3a0e246cb22bb3.png\" width=\"812\" height=\"300\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/639\/3b8\/5d2\/6393b85d2e92f6114e3a0e246cb22bb3.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0448\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043e\u043d\u0438 \u0443\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442. \u0418 \u0432\u0441\u0435 \u044d\u0442\u0438 \u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0442\u0440\u0438\u0448\u0435\u0439\u043a\u0430\u0442\u044c\u0441\u044f \u0438 \u043d\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u0443\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u0434\u0432\u0430 \u043d\u0435\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 core-\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0438\u043b\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043a\u043b\u043e\u043d\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0438\u043c\u0435\u0442\u044c \u0435\u0434\u0438\u043d\u0443\u044e \u043e\u0441\u043d\u043e\u0432\u0443 \u0434\u043b\u044f \u0432\u0441\u0435\u0445, \u0430 \u0435\u0449\u0451 \u043c\u0438\u043a\u0441\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430. \u0418 \u0432\u0441\u0451 \u044d\u0442\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 Angular. <\/p>\n<p><a href=\"https:\/\/gitlab.com\/angular-libs-examples\/example-2\"><strong><u>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442<\/u><\/strong><\/a><\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <\/h3>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0446\u0435\u043b\u044c\u044e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u043e\u0434\u0430 \u0434\u043e\u043c\u0435\u043d\u044b, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434 DDD, \u0430 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0432\u044b \u0435\u0449\u0451 \u0438 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0437\u043d\u044b\u043c \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430\u043c \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0434\u0438\u043a\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0441\u0431\u043e\u0440\u043a\u0438. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0434\u043c\u0438\u043d\u043e\u043a \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u0442\u0434\u0435\u043b\u043e\u0432 \u0438\u043b\u0438 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439.<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 JEST \u043a \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c \u0438 \u043e \u043d\u044e\u0430\u043d\u0441\u0430\u0445 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c CI \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p><em>P.S. \u0425\u043e\u0442\u0435\u043b \u0435\u0449\u0435 \u0440\u0430\u0437 \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u044b&#8230;<\/em><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/8fb\/be6\/517\/8fbbe65179dfba57e6a5f81e5e59f07a.jpeg\" width=\"768\" height=\"385\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8fb\/be6\/517\/8fbbe65179dfba57e6a5f81e5e59f07a.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p><strong>\u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e:<\/strong><\/p>\n<ol>\n<li>\n<p>Angular libs &#8212; <a href=\"https:\/\/angular.io\/guide\/libraries\"><u>https:\/\/angular.io\/guide\/libraries<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p>Angular CLI &#8212; <a href=\"https:\/\/angular.io\/cli\"><u>https:\/\/angular.io\/cli<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p>ng-packagr &#8212; <a href=\"https:\/\/www.npmjs.com\/package\/ng-packagr\"><u>https:\/\/www.npmjs.com\/package\/ng-packagr<\/u><\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/595815\/\"> https:\/\/habr.com\/ru\/articles\/595815\/<\/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<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0412 <a href=\"https:\/\/habr.com\/ru\/company\/karuna\/blog\/588448\/\"><u>\u043f\u0440\u043e\u0448\u043b\u043e\u043c \u043f\u043e\u0441\u0442\u0435<\/u><\/a> \u043c\u044b \u0441 \u0432\u0430\u043c\u0438 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Angular libs, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0443 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c \u0438 \u0434\u0430\u0436\u0435 \u0432\u044b\u043d\u0435\u0441\u043b\u0438 \u043d\u0430\u0448\u0438 \u0430\u0441\u0441\u0435\u0442\u044b \u0432 \u043e\u0434\u043d\u0443 \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u0445\u043e\u0447\u0443 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0442\u0435\u043c\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438, \u043a\u0430\u043a \u0430\u043f\u043e\u0444\u0435\u043e\u0437, \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0441\u0431\u043e\u0440\u043a\u0435 \u0434\u0432\u0443\u0445, \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0412 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u041a\u0430\u0440\u0443\u043d\u044b \u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0447\u0435\u043c\u0443 \u0434\u0430\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0434 \u0441\u0435\u0431\u044f, \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u044f \u0447\u0443\u0436\u0443\u044e \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443.\u00a0<\/p>\n<p><strong>\u0412 \u0445\u043e\u0434\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u043c\u0438 <\/strong><a href=\"https:\/\/gitlab.com\/angular-libs-examples\/example-2\"><strong><u>\u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/u><\/strong><\/a><strong> \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430 \u043c\u044b \u0441 \u0432\u0430\u043c\u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c:<\/strong>\u00a0<\/p>\n<ul>\n<li>\n<p>\u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c tree shaking \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a;<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c core-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u0436\u043d\u0430 \u0432\u0435\u0437\u0434\u0435;<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0432\u0430 \u043a\u043b\u043e\u043d\u0430 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043d\u043e \u0441 \u0440\u0430\u0437\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h3>\n<ol>\n<li>\n<p><a href=\"#tree-shaking\">Tree Shaking \u0438\u043b\u0438 \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u0434\u0430.<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#core\">&#171;\u041e\u0441\u043d\u043e\u0432\u044b \u043e\u0441\u043d\u043e\u0432&#187; (\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0435\u0434\u0438\u043d\u043e\u0439 core-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438).<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#clones\">\u0421\u0431\u043e\u0440\u043a\u0430 \u0434\u0432\u0443\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438 lazy loading.<\/a><\/p>\n<\/li>\n<\/ol>\n<h2>Tree Shaking \u0438\u043b\u0438 \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u0434\u0430<\/h2>\n<p><a class=\"anchor\" name=\"tree-shaking\" id=\"tree-shaking\"><\/a><\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043c\u044b \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043d\u043e\u0432\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441 \u043d\u0438\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u201c\u0432\u0441\u0442\u0440\u044f\u0445\u0438\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u0430\u201d. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u0442\u0432\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u2014 \u043d\u0438\u043a\u0430\u043a. Tree shaking \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438: \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043b\u0438\u0431\u0443, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u0442\u043e \u0432\u0441\u044f \u043e\u043d\u0430 \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0431\u0430\u043d\u0434\u043b. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0448 \u0441\u0431\u043e\u0440\u0449\u0438\u043a <strong>ng-packagr <\/strong>\u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 \u043e\u0431\u0449\u0438\u0439 \u0447\u0430\u043d\u043a, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u0443\u0441\u043e\u0447\u043a\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435\u0432\u043e\u043b\u044c\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0441\u0451. \u041f\u0435\u0447\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u043d\u0435 \u0441\u043f\u0435\u0448\u0438\u0442\u0435 \u0443\u043d\u044b\u0432\u0430\u0442\u044c! \u0415\u0441\u0442\u044c \u0432\u0435\u0441\u044c\u043c\u0430 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u043f\u0440\u0430\u0432\u0434\u0430, \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0442\u043e\u0442 \u0436\u0435 <strong>ng-packagr, <\/strong>\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 <a href=\"https:\/\/github.com\/ng-packagr\/ng-packagr\/blob\/master\/docs\/secondary-entrypoints.md\"><u>sub-entries<\/u><\/a> \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0415\u0441\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e, \u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0447\u0430\u043d\u043a, \u0438 \u0443\u0436\u0435 \u044d\u0442\u0438 \u0447\u0430\u043d\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 tree shaking \u0438 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u044b. \u0417\u0430 \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0444\u0430\u0439\u043b\u044b <strong>public-api.ts<\/strong> \u0438 <strong>package.json, <\/strong>\u043e\u043d\u0438 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u0435\u0449\u0451 \u0438 \u0432 \u043c\u043e\u0434\u0443\u043b\u0438. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443:<\/p>\n<pre><code>some-lib \u251c\u2500\u2500 src |  \u2514\u2500\u2500 lib |\u251c\u2500\u2500 sub-entry-a ||  \u251c\u2500\u2500 *.ts ||  \u251c\u2500\u2500 index.ts ||  \u251c\u2500\u2500 package.json ||  \u2514\u2500\u2500 public-api.ts |\u251c\u2500\u2500 sub-entry-b ||  \u251c\u2500\u2500 *.ts ||  \u251c\u2500\u2500 index.ts ||  \u251c\u2500\u2500 package.json ||  \u2514\u2500\u2500 public-api.ts |\u251c\u2500\u2500 sub-entry-* |\u2514\u2500\u2500 public-api.ts \u2514\u2500\u2500 package.json<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0439\u0434\u0451\u043c\u0441\u044f \u043f\u043e \u043d\u0435\u0439.<\/p>\n<p><strong>some-lib\/src\/public-api.ts \u2014 <\/strong>\u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0432\u0441\u0451 \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0432\u0441\u0435\u0445 \u043d\u0430\u0448\u0438\u0445 sub-entries \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0437\u0430 \u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0439 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 \u2014<strong> import { any } from &#8216;some-lib&#8217;<\/strong>.<\/p>\n<p><strong>some-lib\/src\/lib\/sub-entry-* \u2014 <\/strong>\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430\u043a\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0447\u0430\u043d\u043a.<\/p>\n<p><strong>some-lib\/src\/lib\/sub-entry-a\/public-api.ts \u2014 <\/strong>\u0444\u0430\u0439\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u0432\u0441\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043a \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0447\u0430\u043d\u043a\u0443 \u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<p><strong>some-lib\/src\/lib\/sub-entry-a\/index.ts \u2014 <\/strong>\u0442\u0443\u0442 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u0451 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u0448\u0435. \u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u043e\u0442 \u0438\u043d\u0434\u0435\u043a\u0441\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 <strong>some-lib\/src\/public-api.ts.<\/strong><\/p>\n<p><strong>some-lib\/src\/lib\/sub-entry-a\/package.json \u2014 <\/strong>\u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c ng-packagr \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0447\u0430\u043d\u043a\u0438. \u0412\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u0430\u0448 <strong>some-lib\/src\/lib\/sub-entry-a\/public-api.ts.<\/strong><\/p>\n<p>\u041a\u0430\u043a \u0432\u044b \u0443\u0436\u0435 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c, <strong>some-lib\/src\/lib\/sub-entry-a\/index.ts <\/strong>\u0438 <strong>some-lib\/src\/lib\/sub-entry-a\/package.json <\/strong>\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f, \u0438 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u0447\u0430\u043d\u043a\u0430 \u0432 \u0447\u0430\u043d\u043a.<\/p>\n<h4>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e sub-entry \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043a\u0430\u0445. <\/h4>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0447\u0430\u043d\u043a \u0432 \u0434\u0440\u0443\u0433\u043e\u043c. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u043f\u0443\u0442\u0438 \u043f\u0440\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0443 \u0432\u0430\u0441 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0438 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0443\u0442\u0438 \u0441 <code>..\/..\/<\/code>, \u043e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<blockquote>\n<p><em>ERROR: Unable to write a reference to SomeComponent in example-path\/some-lib\/src\/lib\/sub-entry-a\/some.component.ts from example-path\/some-lib\/src\/lib\/sub-entry-a\/some.module.ts<\/em><\/p>\n<\/blockquote>\n<p>\u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043e\u0434\u043d\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c: sub-entry \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0443\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u044f\u0442 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u0435\u0433\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0412\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u044b \u0432\u0441\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0440\u0430\u0437\u0443 \u0438\u0437 <code>some-lib<\/code>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <strong>import { any } from &#8216;some-lib&#8217;<\/strong>, \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u043f\u0443\u0442\u0438 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0434\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"javascript\">import { SomeModule } from 'some-lib\/src\/lib\/sub-entry-a';<\/code><\/pre>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441 <strong>tsconfig.lib.json<\/strong> \u2014 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0430\u043b\u0438\u0430\u0441 \u0434\u043b\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a:<\/p>\n<details class=\"spoiler\">\n<summary>ui-lib-example\/tsconfig.lib.json<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"json\">\"paths\": {    \"assets-library\/*\": [      \"dist\/assets-library\/*\",      \"dist\/assets-library\"    ],    \"assets-library\": [      \"dist\/assets-library\/*\",      \"dist\/assets-library\"    ],    \"ui-lib-example\/*\": [      \"libs\/ui-lib-example\/*\",      \"libs\/ui-lib-example\"    ],    \"ui-lib-example\": [      \"libs\/ui-lib-example\/*\",      \"libs\/ui-lib-example\"    ] }<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0410 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0430\u043b\u0438\u0430\u0441\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432<strong> tsconfig.json.<\/strong><\/p>\n<details class=\"spoiler\">\n<summary>tsconfig.json<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"json\">\"paths\": {    \"assets-library\/*\": [      \"dist\/assets-library\/*\",      \"dist\/assets-library\"    ],    \"assets-library\": [      \"dist\/assets-library\/*\"      \"dist\/assets-library\"    ],    \"ui-lib-example\/*\": [      \"dist\/ui-lib-example\/*\",      \"dist\/ui-lib-example\"    ],    \"ui-lib-example\": [      \"dist\/ui-lib-example\/*\",      \"dist\/ui-lib-example\"    ] }<\/code><\/pre>\n<\/div>\n<\/details>\n<p><strong>\u0422\u0430\u043a\u0436\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0443 \u043e\u0448\u0438\u0431\u043a\u0443, <\/strong>\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0443\u044e \u0441 <strong>rootDir<\/strong>. \u0412\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<blockquote>\n<p><em>Error File <\/em><code>sub-entry-a\/some.service.ts<\/code><em> is not under &#8216;rootDir&#8217; <\/em><code>sub-entry-b<\/code><em>. <\/em><code>rootDir<\/code><em> is expected to contain all source files.<\/em><\/p>\n<\/blockquote>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c \u0436\u0435, \u0447\u0442\u043e \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0443\u043d\u043a\u0442\u0435: \u0438\u0437 sub-entry \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u0443\u0442\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041d\u0443 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432\u044b\u0448\u0435: \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u0441\u0432\u043e\u0439 \u0447\u0430\u043d\u043a, \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0451 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c.<\/p>\n<p>\u0412 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u0434\u0430, \u043e\u0434\u043d\u0430\u043a\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u0432\u0435\u0441\u043e\u043c\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u044d\u0442\u043e \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u0443\u0441\u043a\u0430 \u043a\u043e\u0434\u0430 \u043d\u0430 \u043c\u0435\u043b\u043a\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 tree shaking, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 sub-entries \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 &#171;\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u0439&#187; \u0432\u044b\u0432\u043e\u0434 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0435 \u0434\u0430\u0434\u0443\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435. \u0410 \u0432\u043e\u0442 \u0435\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0438 \u043e\u0434\u0438\u043d \u043e\u0431\u0449\u0438\u0439 \u0447\u0430\u043d\u043a, \u0442\u043e ng-packagr \u043d\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u0431\u044b \u043d\u0430 \u044d\u0442\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f.<\/p>\n<blockquote>\n<p><em>\u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0438\u043a\u043e\u043d\u043a\u0430\u043c\u0438 \u0432\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <\/em><strong><em>svg-icon,\u00a0 <\/em><\/strong><em>\u0442\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 <\/em><strong><em>svg-icons.ts, <\/em><\/strong><em>\u0442\u0435\u043f\u0435\u0440\u044c \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u0432 \u043c\u043e\u0434\u0443\u043b\u044c <\/em><strong><em>icons. <\/em><\/strong><em>\u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 \u0438\u043a\u043e\u043d\u043e\u043a, \u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0447\u0430\u043d\u043a\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/em><\/p>\n<\/blockquote>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0447\u0430\u043d\u043a\u043e\u0432 \u0432 \u0431\u0438\u043b\u0434\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0434\u043d\u043e\u0433\u043e.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p><a href=\"https:\/\/gitlab.com\/angular-libs-examples\/example-2\/-\/commit\/77d7dfb1ddcd940935d8115d07c06f0f593647fc\"><strong><u>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043a\u043e\u043c\u043c\u0438\u0442<\/u><\/strong><\/a><\/p>\n<h2>\u201c\u041e\u0441\u043d\u043e\u0432\u044b \u043e\u0441\u043d\u043e\u0432\u201d<\/h2>\n<p><a class=\"anchor\" name=\"core\" id=\"core\"><\/a><\/p>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 tree shaking \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430\u0448\u0443 <strong>core-library<\/strong>. \u0423\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Angular \u0432\u044b \u043b\u0438\u0431\u043e \u0447\u0430\u0441\u0442\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0435 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, CommonModule), \u043b\u0438\u0431\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u043d\u0435\u043a\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u044f \u0432\u0441\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0432 \u0438\u043c\u043f\u043e\u0440\u0442\u0430\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0435 \u0432\u0435\u0437\u0434\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0433\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0442\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438.\u00a0<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u043a\u0438\u0439 <code>CoreModule<\/code> \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u043e \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0438\u043c\u043f\u043e\u0440\u0442 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u043e \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u043c\u0435\u0440\u0435 \u0441\u0442\u0440\u0430\u043d\u043d\u043e. \u0410 \u0435\u0441\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0438 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435, \u0442\u043e \u043f\u043e\u043c\u0438\u043c\u043e \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043c\u044b \u0435\u0449\u0451 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u0441\u0443\u0442\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0438\u043b\u0434\u0430, \u0430 \u043e\u043d\u043e \u043d\u0430\u043c \u043d\u0430\u0434\u043e? \u042f\u0432\u043d\u043e \u043d\u0435 \u0440\u0430\u0434\u0438 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0440\u044f\u0441\u043a\u043e\u0439 \u0434\u0435\u0440\u0435\u0432\u0430.\u00a0<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043f\u043e\u043b\u043d\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0435\u0439 \u0432 \u0441\u0435\u0431\u044f \u044d\u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 <code>CoreModule<\/code> \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0451 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u0438, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0435 \u0437\u0430 \u0432\u0430\u0436\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a api. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u044d\u0442\u0438\u043c \u0438 \u0437\u0430\u0439\u043c\u0451\u043c\u0441\u044f. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u044f <code>CommonModule<\/code> \u0438\u0437 Angular \u0438, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, <code>FormsModule<\/code>.<\/p>\n<blockquote>\n<p><strong><em>\u0410\u0445\u0442\u0443\u043d\u0433!<\/em><\/strong><em> \u042d\u0442\u043e \u2014 \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u0434\u0440\u0430\u0436\u0430\u043d\u0438\u044f, \u0430 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430. \u041f\u043e\u0434\u0445\u043e\u0434\u0438\u0442\u0435 \u0441 \u0443\u043c\u043e\u043c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0442\u0430\u043a\u043e\u0433\u043e CoreModule \u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435, \u0432\u0435\u0437\u0434\u0435 \u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043f\u043e\u043c\u0435\u0449\u0451\u043d\u043d\u044b\u0435 \u0432 \u043d\u0435\u0433\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0438!<\/em><\/p>\n<\/blockquote>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 cli \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043d\u0451\u043c \u0432\u0441\u0435 \u0442\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438, \u0447\u0442\u043e \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0443\u043d\u043a\u0442\u0435. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u043d\u043f\u0443\u0442 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 \u0432 <strong>ui-lib-example.component.html.<\/strong><\/p>\n<details class=\"spoiler\">\n<summary>ui-lib-example.component.html<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"xml\">&lt;div *ngIf=\"true\">   &lt;form [formGroup]=\"form\">     &lt;input type=\"text\" formControlName=\"name\"\/>   &lt;\/form> &lt;\/div><\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0410 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c<strong> ui-lib-example.component.ts.<\/strong><\/p>\n<details class=\"spoiler\">\n<summary>ui-lib-example.component.ts<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">@Component({   selector: 'lib-ui-lib-example',   templateUrl: '.\/ui-lib-example.component.html',   styleUrls: ['.\/ui-lib-example.component.scss'],   changeDetection: ChangeDetectionStrategy.OnPush, }) export class UiLibExampleComponent {   form: FormGroup;    private name = 'Ricardo Milos';    constructor(private fb: FormBuilder) {     this.form = this.fb.group({       name: [this.name, Validators.required],     });   } }<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0443, \u0442\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443 <strong>&#171;NG0303: Can&#8217;t bind to &#8216;ngIf&#8217; since it isn&#8217;t a known property of &#8216;div&#8217;.&#187; <\/strong>, \u0430 \u0441 \u0444\u043e\u0440\u043c\u043e\u0439 \u0443 \u043d\u0430\u0441 \u0443\u043f\u0430\u0434\u0435\u0442 \u0431\u0438\u043b\u0434 <strong>ui-lib-example.<\/strong><\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432 <strong>ui-lib-example.module.ts <\/strong>\u043d\u0430\u0448<strong> <\/strong><code>CommonLibraryModule<\/code>,<strong> <\/strong>\u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c <strong>core-library<\/strong>. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 <code>CUSTOM_ELEMENT_SCHEMA<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c <code>CommonModule<\/code> Angular \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u044d\u0442\u043e \u0437\u0430 \u0442\u0435\u0433 \u0442\u0430\u043a\u043e\u0439 &#8212; <code>&lt;svg-icon><\/code>.<\/p>\n<details class=\"spoiler\">\n<summary>ui-lib-example.module.ts<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">import { CommonLibraryModule } from 'core-library';  @NgModule({   declarations: [     UiLibExampleComponent,   ],<\/code><\/pre>\n<\/div>\n<\/details>\n<\/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-413708","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/413708","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=413708"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/413708\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=413708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=413708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=413708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}