{"id":283930,"date":"2017-03-27T00:20:02","date_gmt":"2017-03-26T20:20:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=283930"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=283930","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0439 \u043f\u0435\u0440\u0432\u043e\u0439 \u0438\u0433\u0440\u044b \u043d\u0430 Phaser. \u0427\u0430\u0441\u0442\u044c 0 \u2014 \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u0440\u0430\u0431\u043e\u0442\u0435"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4c6\/0a2\/bcf\/4c60a2bcf9f145f9beb6da77ae2cd6f9.png\" alt=\"Phaser\"\/><\/p>\n<p>  <\/p>\n<h2 id=\"oglavlenie\">\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<ol>\n<li>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u0440\u0430\u0431\u043e\u0442\u0435 [<code>\u0412\u044b \u0442\u0443\u0442<\/code>]<\/li>\n<li>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/li>\n<li>(<em>wip<\/em>) \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432<\/li>\n<li>(<em>wip<\/em>) \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043c\u0438\u0440\u0430<\/li>\n<li>(<em>wip<\/em>) \u0413\u0440\u0443\u043f\u043f\u044b<\/li>\n<li>(<em>wip<\/em>) \u041c\u0438\u0440 \u0444\u0438\u0437\u0438\u043a\u0438<\/li>\n<li>(<em>wip<\/em>) \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/li>\n<li>(<em>wip<\/em>) \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u0435\u0439<\/li>\n<li>(<em>wip<\/em>) \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0448\u0442\u0440\u0438\u0445\u0438<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u0441\u0435\u0440\u0438\u044f \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430\u0443\u0447\u0438\u0442 \u0432\u0430\u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043c \u0438 &quot;\u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u0442\u043e\u043d\u0443&quot; \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0444\u0440\u0435\u043c\u0432\u043e\u0440\u043a\u0430 <a href=\"https:\/\/phaser.io\/\">Phaser<\/a>. \u0417\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u0443\u0440\u0441, \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u0432\u0430\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u0434\u0435\u0438 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0435\u0433\u043e \u0433\u0440\u0430\u043c\u043e\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 <strong>TypeScript<\/strong> \u0438 <strong>Webpack<\/strong>.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<blockquote><p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0445\u043e\u0434 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0437\u044f\u0442 \u0438\u0437 <a href=\"http:\/\/phaser.io\/tutorials\/getting-started\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430<\/a>, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0434\u043e\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434, \u0430 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044f \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430, \u0441 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0441 <strong>ES5<\/strong> \u043d\u0430 <strong>TypeScript<\/strong> \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u042f \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0441\u043a\u0440\u044b\u043b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0442\u0435\u043c\u044b \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u043e.<\/p><\/blockquote>\n<p>\u0414\u0443\u043c\u0430\u044e \u0441\u0442\u043e\u0438\u0442 \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <strong>Phaser<\/strong> <em>v2.6.2<\/em> \u0438 <strong>TypeScript<\/strong> <em>v2.2.1<\/em>.<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0441\u0435\u0445 \u0443\u0440\u043e\u043a\u043e\u0432 \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0432 <a href=\"https:\/\/github.com\/SuperPaintman\/phaser-typescript-tutorial\">\u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a>. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0442\u0435\u0433\u0430\u043c\u0438 \u043f\u043e\u043c\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u044d\u0442\u0430\u043f\u044b \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 \u043a\u043e\u043d\u0435\u0446 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>part-0<\/code> \u2014 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/li>\n<li><code>part-1<\/code> \u2014 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0442\u0430\u0442\u044c\u0438 [#1 \u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435][part-1-url]<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"v-dvuh-slovah-o-phaser\">\u0412 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432\u0430\u0445 \u043e Phaser<\/h2>\n<p>  <\/p>\n<p>[Phaser]<a href=\"https:\/\/phaser.io\/\">phaser-url<\/a>] \u2014 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 (<em>MIT<\/em>), \u043a\u0440\u043e\u0441\u0441-\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u044b\u0435 <strong>HTML5<\/strong> \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u044b\u0445 \u0438\u0433\u0440 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <strong>WebGL<\/strong> \u0438 <strong>Canvas<\/strong>. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432, <strong>Phaser<\/strong> \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0446\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u043f\u043e\u0434 \u043d\u0438\u0445.<\/p>\n<p>  <\/p>\n<h2 id=\"instrumenty\">\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/SuperPaintman\/phaser-typescript-tutorial\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c<\/a> \u0441\u0435\u0431\u0435:<\/p>\n<p>  <\/p>\n<pre><code>git clone https:\/\/github.com\/SuperPaintman\/phaser-typescript-tutorial.git<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <a href=\"https:\/\/nodejs.org\/en\/download\/\"><strong>Node.js<\/strong><\/a> \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 NPM \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<h2 id=\"struktura-proekta\">\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0444\u0440\u0435\u043c\u0432\u043e\u0440\u043a\u0443, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u044b \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u044f \u0432\u0437\u044f\u043b <a href=\"https:\/\/github.com\/SuperPaintman\/phaser-typescript-boilerplate\">\u0434\u0430\u043d\u043d\u044b\u0439 Phaser TypeScript \u0448\u0430\u0431\u043b\u043e\u043d<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <strong>Webpack<\/strong> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0435\u0433\u043e \u0444\u0430\u0439\u043b\u044b (\u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438):<\/p>\n<p>  <\/p>\n<h3 id=\"webpackconfigjs\"><code>webpack.config.js<\/code><\/h3>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 <a href=\"https:\/\/webpack.js.org\/\"><strong>Webpack<\/strong><\/a>. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f <code>NODE_ENV<\/code> \u0441\u043e\u0431\u0435\u0440\u0435\u0442 \u0431\u0438\u043b\u0434 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0438\u043b\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u0438\u043b\u0434 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0430.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">webpack.config.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">'use strict'; \/** Requires *\/ const path                  = require('path');  const webpack               = require('webpack'); const CleanWebpackPlugin    = require('clean-webpack-plugin'); const HtmlWebpackPlugin     = require('html-webpack-plugin'); const ExtractTextPlugin     = require('extract-text-webpack-plugin'); const CheckerPlugin         = require('awesome-typescript-loader').CheckerPlugin; const ImageminPlugin        = require('imagemin-webpack-plugin').default;  const p                     = require('.\/package.json');  \/** Constants *\/ const IS_PRODUCTION     = process.env.NODE_ENV === 'production';  const assetsPath        = path.join(__dirname, 'assets\/'); \/\/ \u043f\u0430\u043f\u043a\u0430 \u0441 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u0438\u0433\u0440\u044b const stylesPath        = path.join(__dirname, 'styles\/'); \/\/ \u043f\u0430\u043f\u043a\u0430 \u0441 css \u0441\u0442\u0438\u043b\u044f\u043c\u0438  \/\/ \u041f\u0443\u0442\u044c \u0434\u043e \u043f\u0430\u043f\u043a\u0438 \u0441 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u043c\u0438 \u0431\u0438\u043b\u0434\u0430\u043c\u0438 phaser. \u0418\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e phaser \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \/\/ \u043f\u043e-\u0441\u0442\u0430\u0440\u0438\u043d\u043a\u0435, \u0435\u0433\u043e (\u0430 \u0442\u0430\u043a\u0436\u0435 \u0435\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438) \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043a\u0430\u043a \/\/ \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442. const phaserRoot        = path.join(__dirname, 'node_modules\/phaser\/build\/custom\/');  \/\/ \u041f\u0443\u0442\u0438 \u0434\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a phaser'\u0430 const phaserPath        = path.join(phaserRoot, 'phaser-split.js'); const pixiPath          = path.join(phaserRoot, 'pixi.js'); const p2Path            = path.join(phaserRoot, 'p2.js');  \/\/ \u041f\u0430\u043f\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u043d \u043d\u0430\u0448 \u0431\u0438\u043b\u0434 const outputPath        = path.join(__dirname, 'dist');  \/\/ \u041f\u0443\u0442\u044c \u0434\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 `index.html` \u0444\u0430\u0439\u043b\u0435 const templatePath      = path.join(__dirname, 'templates\/index.ejs');  \/** Helpers *\/ \/**  * \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043b\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442  * @param  {T[]}  array  * @param  {T}    searchElement  *   * @return {boolean}  *\/ function includes(array, searchElement) {   return !!~array.indexOf(searchElement); }  \/**  * \u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f `expose-loader`, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043a \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c\u0443  * \u043e\u0431\u044a\u0435\u043a\u0442\u0443 window \u043f\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0438\u043c\u0435\u043d\u0438  * @param  {string} modulePath  * @param  {string} name]  *   * @return {Object}  *\/ function exposeRules(modulePath, name) {   return {     test: (path) =&gt; modulePath === path,     loader: 'expose-loader',     options: name   }; }  \/**  * \u0423\u0434\u0430\u043b\u044f\u0435\u0442 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0440\u0430\u0432\u043d\u044b\u0435 `null`  * @param  {T[]} array  *   * @return {T[]}  *\/ function filterNull(array) {   return array.filter((item) =&gt; item !== null); }  \/**  * \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e `fn`, \u0435\u0441\u043b\u0438 `isIt` \u0440\u0430\u0432\u0435\u0442 `true`, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442  * \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f `fail`.  *   * @param  {boolean}  isIt  * @param  {function} fn  * @param  {function} fail  *  * @return {any}  *\/ function only(isIt, fn, fail) {   if (!isIt) {     return fail !== undefined ? fail() : null;   }    return fn(); }  \/**  * \u0425\u0435\u043b\u043f\u0435\u0440 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 `only`. \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0435\u0441\u043b\u0438  * `NODE_ENV` === 'production', \u0442.\u0435. \u0435\u0441\u043b\u0438 \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0430.  * @param  {function} fn  * @param  {function} fail  *  * @return {any}  *\/ const onlyProd = (fn, fail) =&gt; only(IS_PRODUCTION, fn, fail); \/**  * \u0425\u0435\u043b\u043f\u0435\u0440 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 `only`. \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0435\u0441\u043b\u0438  * `NODE_ENV` !== 'production', \u0442.\u0435. \u0435\u0441\u043b\u0438 \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.  * @param  {function} fn  * @param  {function} fail  *  * @return {any}  *\/ const onlyDev = (fn, fail) =&gt; only(!IS_PRODUCTION, fn, fail);  module.exports = {   entry: {     main: path.join(__dirname, 'src\/index.ts')   },   output: {     path: outputPath,     \/\/ \u041d\u0430 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a \u0438\u043c\u0435\u043d\u0430\u043c \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u0445 \u0445\u0435\u0449, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u043e\u0439\u0442\u0438     \/\/ \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u0439     filename: `js\/[name]${onlyProd(() =&gt; '.[chunkhash]', () =&gt; '')}.js`,     chunkFilename: `js\/[name]${onlyProd(() =&gt; '.[chunkhash]', () =&gt; '')}.chunk.js`,     sourceMapFilename: '[file].map',     publicPath: '\/'   },   devtool: onlyDev(() =&gt; 'source-map', () =&gt; ''), \/\/ \u041e\u0442\u043a\u043b\u044e\u0447\u0438\u043c sourcemap'\u044b \u043d\u0430 \u043f\u0440\u043e\u0434\u0435.   resolve: {     extensions: ['.ts', '.js'],     alias: {       pixi:   pixiPath,     \/\/ \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c 'pixi' \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 NPM \u043f\u0430\u043a\u0435\u0442       phaser: phaserPath,   \/\/ \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c 'phaser' \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 NPM \u043f\u0430\u043a\u0435\u0442       p2:     p2Path,       \/\/ \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c 'p2' \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 NPM \u043f\u0430\u043a\u0435\u0442       assets: assetsPath,   \/\/ \u0430\u043b\u0438\u0430\u0441 \u0434\u043e \u043f\u0430\u043f\u043a\u0438 `assets\/`       styles: stylesPath    \/\/ \u0430\u043b\u0438\u0430\u0441 \u0434\u043e \u043f\u0430\u043f\u043a\u0438 `styles\/`     }   },   plugins: filterNull([     \/** DefinePlugin *\/     \/\/ \u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0431\u0443\u0434\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u0434\u043b\u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0430     \/\/ \u043f\u0440\u043e\u0434\u0435, \u0438\u043b\u0438 \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u043f\u0440.     new webpack.DefinePlugin({       IS_PRODUCTION:  JSON.stringify(IS_PRODUCTION),       VERSION:        JSON.stringify(p.version)     }),      \/** JavaScript *\/     \/\/ \u041c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 JS \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u0432\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438     onlyProd(() =&gt; new webpack.optimize.UglifyJsPlugin({       compress: {         warnings: false       },       comments: false     })),      \/** Clean *\/     \/\/ \u0423\u0434\u0430\u043b\u0438\u0442 `dist` \u043f\u0430\u043f\u043a\u0443 \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u043e\u0439     new CleanWebpackPlugin([outputPath]),      \/** TypeScript *\/     new CheckerPlugin(),      \/** Images *\/     \/\/ \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 svg'\u0445\u0438     onlyProd(() =&gt; new ImageminPlugin({       test: \/\\.(jpe?g|png|gif|svg)$\/     })),      \/** Template *\/     \/\/ \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043b\u0430\u0433\u0438\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0434\u043b\u044f \u043d\u0430\u0441 `index.html` \u0444\u0430\u0439\u043b     \/\/ \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 `templatePath`, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0430\u043c \u0432\u0441\u0442\u0430\u0432\u0438\u0442 \u0432 \u044d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u0432\u0441\u0435     \/\/ \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u0441\u0442\u0438\u043b\u0438     new HtmlWebpackPlugin({       title:    'Phaser TypeScript boilerplate project',       template: templatePath     }),      \/** CSS *\/     \/\/ \u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 CSS import'\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 `.css` \u0444\u0430\u0439\u043b (\u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e Webpack     \/\/ \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 CSS \u043f\u0440\u044f\u043c\u043e \u0432 JS \u0444\u0430\u0439\u043b\u044b).     new ExtractTextPlugin({       filename: `css\/[name]${onlyProd(() =&gt; '.[chunkhash]', () =&gt; '')}.css`     }),      \/** Chunks *\/     \/\/ \u0420\u0430\u0437\u043e\u0431\u044c\u0435\u043c \u043d\u0430\u0448\u0443 \u0441\u0431\u043e\u0440\u043a\u0443 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u043e\u0432 (\u0442.\u043a. \u0432\u0435\u043d\u0434\u043e\u0440\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u0444\u0430\u0439\u043b\u044b     \/\/ \u0441\u0430\u043c\u043e\u0433\u043e phaser'\u0430 \u0432\u0440\u044f\u0434 \u043b\u0438 \u0431\u0443\u0434\u0443\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043d\u0435\u0442 \u043d\u0443\u0436\u0434\u044b     \/\/ \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430\u0448\u0438\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0442\u044f\u043d\u0443\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043d\u043e\u0432\u043e. \u0427\u0430\u043d\u043a\u0438 \u043a\u0430\u043a     \/\/ \u0440\u0430\u0437 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0432 \u044d\u0442\u043e\u043c, \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0441\u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c \u0438\u0437 \u043a\u0435\u0448\u0430 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435     \/\/ \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438\u0441\u044c):     \/\/   * \u0427\u0430\u043d\u043a \u0434\u043b\u044f \u043f\u0440\u043e\u0447\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439     new webpack.optimize.CommonsChunkPlugin({       name: 'vendor',       minChunks: (module) =&gt; \/node_modules\/.test(module.resource)     }),     \/\/   * \u0427\u0430\u043d\u043a \u0434\u043b\u044f phaser \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (p2, PIXI, phaser)     new webpack.optimize.CommonsChunkPlugin({       name: 'phaser',       minChunks: (module) =&gt; includes([p2Path, pixiPath, phaserPath], module.resource)     }),     \/\/   * \u0427\u0430\u043d\u043a \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 webpack'\u0430     new webpack.optimize.CommonsChunkPlugin({       name: 'commons'     })   ]),   devServer: {     contentBase: path.join(__dirname, 'dist'),     compress: true,     port: 8080,     inline: true,     watchOptions: {       aggregateTimeout: 300,       poll: true,       ignored: \/node_modules\/     }   },   module: {     rules: [       \/** Assets *\/       \/\/ \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0444\u0430\u0439\u043b\u044b \u0438\u0437 asset'\u043e\u0432       {         test: (path) =&gt; path.indexOf(assetsPath) === 0,         loader: 'file-loader',         options: {           name: `[path][name]${onlyProd(() =&gt; '.[sha256:hash]', () =&gt; '')}.[ext]`         }       },        \/** CSS *\/       {         test: \/\\.styl$\/,         exclude: \/node_modules\/,         loader: ExtractTextPlugin.extract({           fallback: 'style-loader',           use: [             'css-loader',             'stylus-loader'           ]         })       },        \/** JavaScript *\/       exposeRules(pixiPath, 'PIXI'),     \/\/ \u0434\u043e\u0431\u0430\u0432\u0438\u0442 `PIXI` \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 `window`       exposeRules(p2Path, 'p2'),         \/\/ \u0434\u043e\u0431\u0430\u0432\u0438\u0442 `p2` \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 `window`       exposeRules(phaserPath, 'Phaser'), \/\/ \u0434\u043e\u0431\u0430\u0432\u0438\u0442 `Phaser` \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 `window`       {         test: \/\\.ts$\/,         exclude: \/node_modules\/,         loader: 'awesome-typescript-loader'       }     ]   } };<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h3 id=\"assets\"><code>assets\/<\/code><\/h3>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f: \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043c\u0443\u0437\u044b\u043a\u0443, JSON \u0438 \u043f\u0440\u043e\u0447\u0435\u0435.<\/p>\n<p>  <\/p>\n<h3 id=\"stylesstylestyl\"><code>styles\/style.styl<\/code><\/h3>\n<p>  <\/p>\n<p>\u0412 \u043d\u0435\u043c \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f <strong>CSS<\/strong> \u0441\u0442\u0438\u043b\u0438 (\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 <a href=\"http:\/\/stylus-lang.com\/\"><strong>Stylus<\/strong><\/a>) \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0435\u0440\u0438\u0438, \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u044d\u0442\u043e\u0433\u043e:<\/p>\n<p>  <\/p>\n<pre><code>body   margin: 0px<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"templatesindexejs\"><code>templates\/index.ejs<\/code><\/h3>\n<p>  <\/p>\n<p><a href=\"https:\/\/github.com\/tj\/ejs\"><strong>EJS<\/strong><\/a> \u0448\u0430\u0431\u043b\u043e\u043d \u0434\u043b\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438\u0433\u0440\u044b (<strong>Webpack<\/strong> \u0441\u0430\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0432 \u043d\u0435\u0433\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0432\u0441\u0435\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0438 \u0441\u0442\u0438\u043b\u0435\u0439):<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt;   &lt;meta charset=&quot;UTF-8&quot;&gt;   &lt;title&gt;&lt;%= htmlWebpackPlugin.options.title %&gt;&lt;\/title&gt; &lt;\/head&gt; &lt;body&gt; &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"tsconfigjson\"><code>tsconfig.json<\/code><\/h3>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f <a href=\"https:\/\/www.typescriptlang.org\/\"><strong>TypeScript<\/strong><\/a>:<\/p>\n<p>  <\/p>\n<pre><code>{   &quot;compilerOptions&quot;: {     &quot;target&quot;: &quot;es5&quot;, \/\/ \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u043c\u0438     &quot;module&quot;: &quot;commonjs&quot;,     &quot;moduleResolution&quot;: &quot;node&quot;,     &quot;sourceMap&quot;: true,     &quot;removeComments&quot;: false,     &quot;noImplicitAny&quot;: false,     &quot;pretty&quot;: true   },   &quot;files&quot;: [     \/\/ \u041d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0442\u043a\u0443\u0434\u0430 \u0442\u0430\u0439\u043f\u0438\u043d\u0433\u0438 Phaser'\u0430 \u044f\u0432\u043d\u043e, \u0442.\u043a. \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435     \/\/ \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0436\u0434\u0443     \/\/ \u0441\u043e\u0431\u043e\u0439.     &quot;.\/node_modules\/phaser\/typescript\/box2d.d.ts&quot;,     &quot;.\/node_modules\/phaser\/typescript\/p2.d.ts&quot;,     &quot;.\/node_modules\/phaser\/typescript\/phaser.comments.d.ts&quot;,     &quot;.\/node_modules\/phaser\/typescript\/pixi.comments.d.ts&quot;   ],   &quot;include&quot;: [     \/\/ \u0410 \u0442\u0430\u043a-\u0436\u0435 \u0443\u043a\u0430\u0436\u0435\u043c \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0440\u0430\u0442\u044c \u0442\u0430\u0439\u043f\u0438\u043d\u0433\u0438 \u043f\u043e glob'\u0443     &quot;.\/src\/**\/*.ts&quot;,     &quot;.\/node_modules\/@types\/**\/*.ts&quot;   ] }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"srctypingsdts\"><code>src\/typings.d.ts<\/code><\/h3>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0432 <code>webpack.DefinePlugin<\/code>:<\/p>\n<p>  <\/p>\n<pre><code>declare const IS_PRODUCTION: boolean; declare const VERSION: string;<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"srcindexts\"><code>src\/index.ts<\/code><\/h3>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0430\u0439\u043b \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0439 \u0432 \u043d\u0435\u0433\u043e:<\/p>\n<p>  <\/p>\n<pre><code>'use strict';<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u0439 \u043e\u0441\u043d\u043e\u0432\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u0440.<\/p>\n<p>  <\/p>\n<p><a href=\"#oglavlenie\"><strong>\u041a \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044e<\/strong><\/a><\/p>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/324894\/\"> https:\/\/habrahabr.ru\/post\/324894\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4c6\/0a2\/bcf\/4c60a2bcf9f145f9beb6da77ae2cd6f9.png\" alt=\"Phaser\"\/><\/p>\n<p>  <\/p>\n<h2 id=\"oglavlenie\">\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<ol>\n<li>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u0440\u0430\u0431\u043e\u0442\u0435 [<code>\u0412\u044b \u0442\u0443\u0442<\/code>]<\/li>\n<li>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/li>\n<li>(<em>wip<\/em>) \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432<\/li>\n<li>(<em>wip<\/em>) \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043c\u0438\u0440\u0430<\/li>\n<li>(<em>wip<\/em>) \u0413\u0440\u0443\u043f\u043f\u044b<\/li>\n<li>(<em>wip<\/em>) \u041c\u0438\u0440 \u0444\u0438\u0437\u0438\u043a\u0438<\/li>\n<li>(<em>wip<\/em>) \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/li>\n<li>(<em>wip<\/em>) \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u0435\u0439<\/li>\n<li>(<em>wip<\/em>) \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0448\u0442\u0440\u0438\u0445\u0438<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u0441\u0435\u0440\u0438\u044f \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430\u0443\u0447\u0438\u0442 \u0432\u0430\u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043c \u0438 &quot;\u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u0442\u043e\u043d\u0443&quot; \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0444\u0440\u0435\u043c\u0432\u043e\u0440\u043a\u0430 <a href=\"https:\/\/phaser.io\/\">Phaser<\/a>. \u0417\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u0443\u0440\u0441, \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u0432\u0430\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u0434\u0435\u0438 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0435\u0433\u043e \u0433\u0440\u0430\u043c\u043e\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 <strong>TypeScript<\/strong> \u0438 <strong>Webpack<\/strong>.<\/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-283930","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283930","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=283930"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283930\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}