{"id":293119,"date":"2019-08-08T09:00:54","date_gmt":"2019-08-08T09:00:54","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=293119"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=293119","title":{"rendered":"5 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0434\u043b\u044f webpack"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>  \u0423 webpack&#8217;\u0430 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043d\u043e\u0433\u0438\u0435 \u043d\u0435 \u0437\u043d\u0430\u044e\u0442 \u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u044f \u0441\u043e\u0431\u0440\u0430\u043b 5 \u0442\u0430\u043a\u0438\u0445, \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0437\u0434\u043e\u0440\u043e\u0432\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0432\u0430\u043c \u0436\u0438\u0437\u043d\u044c!<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qo\/rk\/oj\/qorkojoahtehuif6houlmovzmy4.png\"><br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>1. Unused files webpack plugin<\/h2>\n<p>  \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c\u0441\u044f. \u0415\u0441\u043b\u0438 \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438, \u0442\u043e \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0432 \u043d\u0435\u043c \u0441\u043a\u043e\u043f\u044f\u0442\u0441\u044f \u043c\u0443\u0441\u043e\u0440\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0437\u043d\u0430\u0442\u044c \u043e \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u0441\u0432\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 unused-files-webpack-plugin:<\/p>\n<pre><code class=\"bash\">npm i unused-files-webpack-plugin <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/* webpack.config.js *\/  const { UnusedFilesWebpackPlugin } = require('unused-files-webpack-plugin');  module.exports = {   \/* ... *\/   plugins: [     \/* ... *\/     new UnusedFilesWebpackPlugin(),   ], }; <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043e \u043b\u044e\u0431\u044b\u0445 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445:<\/p>\n<pre><code class=\"bash\">src\/ \u251c\u2500\u2500 index.js \u2514\u2500\u2500 someFile.js (\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">WARNING in  UnusedFilesWebpackPlugin found some unused files: src\/someFile.js <\/code><\/pre>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0438:<\/p>\n<p>  \u2192 <a href=\"https:\/\/github.com\/tomchentw\/unused-files-webpack-plugin\">Github<\/a> <br \/>  \u2192 <a href=\"https:\/\/www.npmjs.com\/package\/unused-files-webpack-plugin\">NPM<\/a> <\/p>\n<h2>2. Case sensitive paths webpack plugin<\/h2>\n<p>  \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 OSX \u0447\u0430\u0441\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0435 \u0438 \u0437\u0430\u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u0431\u0443\u043a\u0432\u044b \u0432 \u043f\u0443\u0442\u0438 \u043f\u0440\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0435 \u043c\u043e\u0434\u0443\u043b\u044f. \u041d\u0430 \u043c\u0430\u043a\u0435 \u0441\u0431\u043e\u0440\u043a\u0430 \u0441\u043e\u0431\u0435\u0440\u0435\u0442\u0441\u044f, \u043d\u043e \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043a \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u043e\u043d\u0430 \u0443\u043f\u0430\u0434\u0435\u0442. <\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c case-sensitive-paths-webpack-plugin:<\/p>\n<pre><code class=\"bash\">npm i case-sensitive-paths-webpack-plugin <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/* webpack.config.js *\/  const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');  module.exports = {   \/* ... *\/   plugins: [     \/* ... *\/     new CaseSensitivePathsPlugin(),   ], }; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0441 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u043c \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<pre><code class=\"javascript\">\/* index.js *\/  import someFile from '.\/SOMEFILE'; <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/* someFile.js *\/  export default () =&gt; {   console.log('Hello!'); }; <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">ERROR in index.js Module not found: Error: [CaseSensitivePathsPlugin] `SOMEFILE.js` does not match the corresponding path on disk `someFile.js`. <\/code><\/pre>\n<p>  \u042d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0442\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e eslint-\u043f\u043b\u0430\u0433\u0438\u043d\u0430 <a href=\"https:\/\/github.com\/benmosher\/eslint-plugin-import\/blob\/master\/docs\/rules\/no-unresolved.md\">import\/no-unresolved<\/a>. <\/p>\n<p>  \u0412 typescript \u0435\u0441\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0430\u044f \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u043e\u043f\u0446\u0438\u044f \u2014 forceConsistentCasingInFileNames. \u041d\u043e \u0432\u0435\u0434\u0435\u0442 \u043e\u043d\u0430 \u0441\u0435\u0431\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0430\u0447\u0435: \u043e\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0447\u0442\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0435\u0441\u0442 \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0443, \u0441\u0430\u043c\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0438:<\/p>\n<p>  \u2192 <a href=\"https:\/\/github.com\/Urthen\/case-sensitive-paths-webpack-plugin\">Github<\/a> <br \/>  \u2192 <a href=\"https:\/\/www.npmjs.com\/package\/case-sensitive-paths-webpack-plugin\">NPM<\/a> <\/p>\n<h2>3. Inspectpack<\/h2>\n<p>  \u0412 \u0432\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u0447\u0442\u043e \u0432\u044b \u0438 \u0432\u0430\u0448\u0438 \u043f\u0430\u043a\u0435\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0422\u043e\u0433\u0434\u0430 \u0432 \u0431\u0430\u043d\u0434\u043b\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043f\u0438\u0439 \u043f\u0430\u043a\u0435\u0442\u0430, \u0447\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u0443\u043a\u0430\u0437\u0430\u0432 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<p>  Inspectpack \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"bash\">npm i inspectpack <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/* webpack.config.js *\/  const { DuplicatesPlugin } = require('inspectpack\/plugin');  module.exports = {   \/* ... *\/   plugins: [     \/* ... *\/     new DuplicatesPlugin(),   ], }; <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043f\u043b\u0430\u0433\u0438\u043d, \u0442\u043e \u043f\u0440\u0438 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u043a\u043e\u043f\u0438\u0439 \u043f\u0430\u043a\u0435\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0441\u043a\u0430\u043a\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"javascript\">\/* package.json *\/  {   \/* ... *\/   \"name\": \"my-app\",   \"dependencies\": {     \"lodash\": \"4.1.0\",     \"one\": \"1.2.3\"   } } <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/* node_modules\/one\/package.json *\/  {   \/* ... *\/   \"name\": \"one\",   \"dependencies\": {     \"lodash\": \"3.0.0\"   } } <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/* index.js *\/  import _ from 'lodash'; import 'one';  \/* ... *\/ <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">WARNING in Duplicate Sources \/ Packages - Duplicates found! \ufe0f  * Duplicates: Found 2 similar files across 2 code sources (both identical + similar)   accounting for 703 bundled bytes. * Packages: Found 1 packages with 2 resolved, 2 installed, and 2 depended versions.  ## bundle.js lodash (Found 2 resolved, 2 installed, 2 depended. Latest 4.1.0.)   3.0.0 ~\/one\/~\/lodash     scenario-new-webpack-new-npm-unflattened@* -&gt; one@1.2.3 -&gt; lodash@3.0.0   4.1.0 ~\/lodash     scenario-new-webpack-new-npm-unflattened@* -&gt; lodash@4.1.0 <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0438\u0440\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0412\u043e \u0432\u0441\u0435\u0445 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0434\u043b\u044f \u0442\u0440\u0435\u043a\u0438\u043d\u0433\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <a href=\"https:\/\/sentry.io\/\">sentry<\/a>. \u0415\u0433\u043e <a href=\"https:\/\/github.com\/getsentry\/sentry-javascript\">javascript SDK<\/a> \u0440\u0430\u0437\u0431\u0438\u0442\u043e \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 tslib@^1.9.3.<\/p>\n<p>  \u0412 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043f\u043e \u043e\u0448\u0438\u0431\u043a\u0435 \u0432 dependencies \u0431\u044b\u043b \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d tslib@1.9.0, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e tslib \u043e\u0434\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430. \u041f\u0430\u043a\u0435\u0442\u044b sentry \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0438 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ql\/cv\/v-\/qlcvv-kdmvjlh6unt3mvqdmzb5e.png\"><br \/>  <font color=\"#999999\"><i>\u0411\u043e\u0440\u0434\u043e\u0432\u044b\u043c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b \u043a\u043e\u043f\u0438\u0438 tslib<\/i><\/font><\/p>\n<pre><code class=\"bash\">Parsed size: 121.03 KB Gzipped size: 27.16 KB <\/code><\/pre>\n<p>  \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f inspectpack \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0430\u0448\u043b\u0430\u0441\u044c: \u044f \u0443\u0434\u0430\u043b\u0438\u043b \u0438\u0437 dependencies \u0432 package.json tslib@1.9.0, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c tslib@^1.9.3 \u043e\u0442 sentry \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0430\u0441\u044c \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0443\u0440\u043e\u0432\u043d\u0435, \u0438 \u043f\u0430\u043a\u0435\u0442\u044b \u0441\u0442\u0430\u043b\u0438 \u0432\u0435\u0441\u0438\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u043d\u0430 26 \u041a\u0411\u0430\u0439\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ko\/k-\/vt\/kok-vtwadhbf-508vpuosa0du_g.png\"><\/p>\n<pre><code class=\"bash\">Parsed size: 94.5 KB Gzipped size: 26.5 KB <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 <a href=\"https:\/\/github.com\/darrenscerri\/duplicate-package-checker-webpack-plugin\">duplicate-package-checker-webpack-plugin<\/a>. \u041d\u043e \u0441 \u043d\u0438\u043c \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u2014 \u043e\u043d <a href=\"https:\/\/github.com\/darrenscerri\/duplicate-package-checker-webpack-plugin\/issues\/19\">\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442<\/a> \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \u043e\u0434\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0442.\u0435. \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u0434\u0435\u0440\u043e\u043c, \u0433\u0434\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 tslib, \u043e\u043d \u043d\u0430\u0439\u0442\u0438 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442.<\/p>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0438:<\/p>\n<p>  \u2192 <a href=\"https:\/\/github.com\/FormidableLabs\/inspectpack\">Github<\/a> <br \/>  \u2192 <a href=\"https:\/\/www.npmjs.com\/package\/inspectpack\">NPM<\/a><\/p>\n<h2>4. Circular dependency plugin<\/h2>\n<p>  \u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u2014 \u0434\u0432\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442 \u0434\u0440\u0443\u0433-\u0434\u0440\u0443\u0433\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0440\u0443\u0433\u043e\u0432\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c. \u0422\u0430\u043a\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0435\u044f\u0432\u043d\u043e, \u0447\u0435\u0440\u0435\u0437 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u0412 \u0440\u0435\u0434\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u2014 \u044d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0441\u0440\u0430\u0437\u0443 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0440\u0443\u0433\u043e\u0432\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0438 \u0443\u0431\u0440\u0430\u0442\u044c \u0435\u0435, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 circular-dependency-plugin:<\/p>\n<pre><code class=\"bash\">npm i circular-dependency-plugin <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/* webpack.config.js *\/  const CircularDependencyPlugin = require('circular-dependency-plugin');  module.exports = {   \/* ... *\/   plugins: [     \/* ... *\/     new CircularDependencyPlugin(),   ], }; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"javascript\">\/* first.js *\/  import second from '.\/second'  \/* ... *\/ <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/* second.js *\/  import first from '.\/first'  \/* ... *\/ <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">WARNING in Circular dependency detected: first.js -&gt; second.js -&gt; first.js  WARNING in Circular dependency detected: second.js -&gt; first.js -&gt; second.js <\/code><\/pre>\n<p>  \u041f\u043e\u0445\u043e\u0436\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0440\u0435\u0448\u0430\u044e\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 <a href=\"https:\/\/github.com\/benmosher\/eslint-plugin-import\/blob\/master\/docs\/rules\/no-cycle.md\">import\/no-cycle<\/a> \u0434\u043b\u044f eslint \u0438<a href=\"https:\/\/www.npmjs.com\/package\/tslint-no-circular-imports\"> tslint-no-circular-imports<\/a> \u0434\u043b\u044f tslint. \u0423 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e, \u043f\u0440\u0430\u0432\u0434\u0430, \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u0442\u0438\u043f\u043e\u0432, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 \u2014 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u043e \u043f\u0438\u0441\u0430\u0442\u044c tslint:disable.<\/p>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0438:<\/p>\n<p>  \u2192 <a href=\"https:\/\/github.com\/aackerman\/circular-dependency-plugin\">Github<\/a> <br \/>  \u2192 <a href=\"https:\/\/www.npmjs.com\/package\/circular-dependency-plugin\">NPM<\/a><\/p>\n<h2>5. Speed measure webpack plugin<\/h2>\n<p>  \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u043e\u0442\u0435\u043d \u0444\u0430\u0439\u043b\u043e\u0432, \u0441\u0431\u043e\u0440\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u0434\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0438\u043d\u0443\u0442.<\/p>\n<p>  \u0417\u0430\u043c\u0435\u0440\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0448\u0430\u0433 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u043e\u043c\u043e\u0436\u0435\u0442 speed-measure-webpack-plugin:<\/p>\n<pre><code class=\"bash\">npm i speed-measure-webpack-plugin <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/* webpack.config.js *\/  const SpeedMeasurePlugin = require(\"speed-measure-webpack-plugin\");  const smp = new SpeedMeasurePlugin();  module.exports = smp.wrap({   \/* ... *\/ }); <\/code><\/pre>\n<p>  \u0412 \u0432\u044b\u0432\u043e\u0434\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u043e\u0431\u0449\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0431\u043e\u0440\u043a\u0438, \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u043b\u043e\u0430\u0434\u0435\u0440\u043e\u0432:<\/p>\n<pre><code class=\"bash\"> SMP General output time took 48.97 secs   SMP - Plugins TerserPlugin took 19.6 secs OptimizeCssAssetsWebpackPlugin took 2.65 secs MiniCssExtractPlugin took 0.261 secs VueLoaderPlugin took 0.216 secs  \/* ... *\/   SMP - Loaders mini-css-extract-plugin, and  css-loader, and  postcss-loader took 21.81 secs   module count = 33  cache-loader, and  babel-loader, and  ts-loader, and  tslint-loader took 21.63 secs   module count = 240  \/* ... *\/ <\/code><\/pre>\n<p>  \u041c\u043d\u0435 \u043e\u043d \u043f\u043e\u043c\u043e\u0433 \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e \u043c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0443 TerserPlugin: \u044f \u0443\u0431\u0440\u0430\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0432\u043b\u0438\u044f\u043b\u0438 \u043d\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u0438 \u0443\u0441\u043a\u043e\u0440\u0438\u043b \u0435\u0433\u043e \u043d\u0430 \u043f\u0430\u0440\u0443-\u0442\u0440\u043e\u0439\u043a\u0443 \u0441\u0435\u043a\u0443\u043d\u0434. <\/p>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0438:<\/p>\n<p>  \u2192 <a href=\"https:\/\/github.com\/stephencookdev\/speed-measure-webpack-plugin\">Github<\/a> <br \/>  \u2192 <a href=\"https:\/\/www.npmjs.com\/package\/speed-measure-webpack-plugin\">NPM<\/a><\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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\/company\/constanta\/blog\/461105\/\"> https:\/\/habr.com\/ru\/company\/constanta\/blog\/461105\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>  \u0423 webpack&#8217;\u0430 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043d\u043e\u0433\u0438\u0435 \u043d\u0435 \u0437\u043d\u0430\u044e\u0442 \u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u044f \u0441\u043e\u0431\u0440\u0430\u043b 5 \u0442\u0430\u043a\u0438\u0445, \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0437\u0434\u043e\u0440\u043e\u0432\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0432\u0430\u043c \u0436\u0438\u0437\u043d\u044c!<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qo\/rk\/oj\/qorkojoahtehuif6houlmovzmy4.png\">  <\/p>\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-293119","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293119","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=293119"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293119\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=293119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=293119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=293119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}