{"id":386321,"date":"2024-06-29T06:38:20","date_gmt":"2024-06-29T06:38:20","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=386321"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=386321","title":{"rendered":"<span>Figma plugin API \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438\u043c \u044f\u0437\u044b\u043a\u043e\u043c. \u0427\u0430\u0441\u0442\u044c 3<\/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><strong>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c React<\/strong><\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/589819\/\" rel=\"noopener noreferrer nofollow\"><u>&lt;&lt; \u0427\u0430\u0441\u0442\u044c 2 \u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 Figma<\/u><\/a><\/p>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0434\u0432\u0443\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u044f \u043e\u043f\u0438\u0441\u0430\u043b, \u043a\u0430\u043a \u0431\u0435\u0437 \u043e\u0441\u043e\u0431\u044b\u0445 \u0443\u0441\u0438\u043b\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f Figma. \u0418 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u043b\u0430\u0433\u0438\u043d, \u044d\u0442\u043e\u0433\u043e \u0437\u043d\u0430\u043d\u0438\u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u041d\u043e \u0432\u043e\u0442 \u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439, \u0447\u0435\u043c \u043f\u0430\u0440\u0430 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0438\u043d\u043f\u0443\u0442\u043e\u0432, \u0435\u0441\u043b\u0438 \u043d\u0430\u0432\u043e\u0440\u043e\u0447\u0435\u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439, \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u0443\u0434\u043e\u0431\u0435\u043d. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043d\u0430\u0434\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0432 html. \u0420\u0435\u0448\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0435\u0433\u043e \u0432\u0435\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e <a href=\"https:\/\/www.figma.com\/plugin-docs\/bundling-react\/\" rel=\"noopener noreferrer nofollow\"><strong><u>React<\/u><\/strong><\/a><strong> <\/strong>\u0438 \u0435\u0433\u043e \u043f\u0440\u0435\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0441\u0442\u0432\u043e <a href=\"https:\/\/www.figma.com\/plugin-docs\/bundling-webpack\/\" rel=\"noopener noreferrer nofollow\"><strong><u>Webpack<\/u><\/strong><\/a>. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u043f\u043b\u0430\u0433\u0438\u043d\u0443 \u043e\u0431\u0435\u0438\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Figma. \u0418 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u0435\u0441\u043b\u0438 \u0431\u044b \u043d\u0435 \u043e\u0434\u043d\u043e \u043d\u043e, \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0410 \u0440\u0430\u0437 \u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e \u043d\u0430 <strong>node <\/strong>\u0432\u0435\u0440\u0441\u0438\u0438 17.1.0 \u0438 <strong>npm<\/strong> \u0432\u0435\u0440\u0441\u0438\u0438 8.1.2<\/p>\n<p>\u0418 \u0442\u0430\u043a, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"javascript\">npm init<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/p>\n<pre><code class=\"javascript\">npm install --save-dev css-loader html-webpack-inline-source-plugin@beta html-webpack-plugin copy-webpack-plugin style-loader file-loader url-loader webpack webpack-cli babel-loader @babel\/preset-env @babel\/preset-react       <\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c react<\/p>\n<pre><code class=\"javascript\">npm install --save react-dom react<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u0430\u043f\u043a\u0443 <strong>src<\/strong> \u0438 \u0432 \u043d\u0435\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/38a\/4eb\/a25\/38a4eba25cd5a9ae5e0fa0246a41cddd.png\" width=\"200\" height=\"172\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/38a\/4eb\/a25\/38a4eba25cd5a9ae5e0fa0246a41cddd.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u044d\u0442\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 <strong>manifest.json<\/strong><\/p>\n<pre><code class=\"json\">{  \"name\": \"Figma Plugin with React\",  \"api\": \"1.0.0\",  \"main\": \".\/plugin.js\",  \"ui\": \".\/ui.html\",  \"editorType\": [    \"figma\"  ] } <\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0435 \u0442\u043e\u0436\u0435, \u0447\u0442\u043e \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445, \u0441 \u0442\u043e\u0439 \u043b\u0438\u0448\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0435\u0439, \u0447\u0442\u043e \u043f\u0443\u0442\u0438 \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u0430 \u043d\u0435 \u043a\u043e\u0440\u043d\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 <strong>ui.html. <\/strong>\u0412 \u043d\u0435\u0433\u043e \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c body, \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u043f\u043e\u044f\u0441\u043d\u044e \u0437\u0430\u0447\u0435\u043c, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<pre><code class=\"xml\">&lt;body>    &lt;div id=\"figma-plugin-container\">&lt;\/div> &lt;\/body><\/code><\/pre>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0438\u0434\u0435\u0442 <strong>ui.js<\/strong><\/p>\n<pre><code class=\"javascript\">import React from 'react'; import ReactDom from 'react-dom'; import App from '.\/App';  ReactDom.render(    &lt;App \/>,    document.querySelector('#figma-plugin-container') );<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u043c\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c react \u0438 react-dom, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0434\u0443\u043b\u044c App, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043c \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <strong>plugin.js<\/strong> \u043c\u044b \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u043c \u043e\u043a\u043d\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430.<\/p>\n<pre><code class=\"javascript\">figma.showUI (    __html__,    {width: 400, height: 400} );<\/code><\/pre>\n<p>\u0424\u0430\u0439\u043b <strong>App\/index.js <\/strong>\u0438 <strong>App\/module.css<\/strong> \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0442\u043e\u0436\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c\u0438, \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u0445 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0437\u0436\u0435<\/p>\n<p><em>App\/index.js<\/em><\/p>\n<pre><code class=\"javascript\">import React from \"react\";  export default function App() {    return (        &lt;div className=\"App\">                   &lt;\/div>    ) }<\/code><\/pre>\n<p><em>App\/module.css<\/em><\/p>\n<pre><code class=\"css\">body, html {    padding: 0;    margin: 0;    width: 100%;    height: 100%; }  .app {    box-sizing: border-box;    width: 100%;    height: 100%;    padding: 10px; }<\/code><\/pre>\n<p>\u041a\u0430\u0440\u043a\u0430\u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0433\u043e\u0442\u043e\u0432. \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c\u00a0 \u0432 \u043a\u043e\u0440\u043d\u0435 \u0444\u0430\u0439\u043b <strong>webpack.config.js <\/strong>\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"javascript\">const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const path = require('path');  module.exports = (env, argv) => ({    mode: argv.mode === 'production' ? 'production' : 'development',     devtool: argv.mode === 'production' ? false : 'inline-source-map',     entry: {        ui: '.\/src\/ui.js',    },     module: {        rules: [            {                test: \/\\.m?js$\/,                exclude: \/node_modules(?!\\\/ansi-regex)(?!\\\/strip-ansi)\/,                use: {                    loader: 'babel-loader',                    options: {                        presets: [                            '@babel\/preset-env',                            '@babel\/react',                            {                                plugins: ['@babel\/plugin-proposal-class-properties'],                            },                        ],                    },                },            },            { test: \/\\.css$\/, use: ['style-loader', { loader: 'css-loader' }] },            { test: \/\\.(png|jpg|gif|webp|svg)$\/, loader: 'url-loader' },            {                test: \/\\.(png|jpe?g|gif)$\/i,                loader: 'file-loader',            }        ],    },     resolve: {        extensions: ['.jsx', '.js'],        modules: [            path.resolve(__dirname, 'node_modules'),            path.resolve(__dirname, 'src'),            path.resolve(__dirname, ''),        ],    },     output: {        filename: '[name].js',        publicPath: \"\/\",    },     plugins: [        new HtmlWebpackPlugin({            template: \".\/src\/ui.html\",            filename: \"ui.html\",            inlineSource: \".(js)$\",            inject: \"body\",            cache: false,            }),        new HtmlWebpackInlineSourcePlugin(HtmlWebpackPlugin),        new CopyWebpackPlugin({            patterns: [{                from: '.\/src\/plugin.js',                to: '',            }, {                from: '.\/src\/manifest.json',                to: '',            }],        })    ], })<\/code><\/pre>\n<p>\u041d\u0435 \u0441\u0442\u0430\u043d\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0435\u0433\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u0434\u043e\u0443\u043c\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 <a href=\"https:\/\/webpack.js.org\/guides\/\" rel=\"noopener noreferrer nofollow\"><u>\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439<\/u><\/a> webpack. \u041e\u0431\u0440\u0430\u0449\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0443<\/p>\n<pre><code class=\"javascript\">inject: \"body\"<\/code><\/pre>\n<p>\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c <a href=\"https:\/\/www.figma.com\/plugin-docs\/bundling-webpack\/\" rel=\"noopener noreferrer nofollow\"><u>\u0433\u0430\u0439\u0434\u0435<\/u><\/a> Figma \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 HtmlWebpackInlineSourcePlugin. \u0412\u043e\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0441\u044f body \u0432 <strong>ui.html<\/strong>. \u0422\u0443\u0434\u0430 webpack \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 <strong>ui.js<\/strong>.<\/p>\n<p>\u0412\u043e\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0432\u0441\u0435, \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 <strong>package.json<\/strong>\u00a0 \u043f\u0430\u0440\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/p>\n<pre><code class=\"json\">\"scripts\": {    \"start\": \"npx webpack --mode=development --watch\",    \"build\": \"npx webpack --mode=production\" }<\/code><\/pre>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 <strong>start<\/strong> \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u0441\u0431\u043e\u0440\u043a\u0443 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 <strong>development, <\/strong>\u0430 \u0444\u043b\u0430\u0433<strong> -watch <\/strong>\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445. \u0421\u0440\u0438\u043f\u0442 \u0436\u0435 <strong>build<\/strong> \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0431\u043e\u0440\u043a\u0443 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 <strong>production<\/strong>, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u043a \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/p>\n<pre><code class=\"javascript\">npm run start<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043f\u0430\u043f\u043a\u0430 <strong>dist<\/strong> \u0441\u043e \u0441\u0431\u043e\u0440\u043a\u043e\u0439 \u043f\u043b\u0430\u0433\u0438\u043d\u0430. \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u043f\u043b\u0430\u0433\u0438\u043d \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 <strong>manifest.json<\/strong> \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0438, \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u043f\u043b\u0430\u0433\u0438\u043d, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 react.<\/p>\n<p>\u041a\u043e\u0434 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 <a href=\"https:\/\/gitlab.com\/figma-plugin-examples\/figma-plugin-with-react\" rel=\"noopener noreferrer nofollow\"><u>\u0442\u0443\u0442<\/u><\/a>. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e, \u043a\u0430\u043a \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f Figma, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044f \u0432 \u043d\u0435\u043c \u0432\u0441\u0435 \u043f\u043b\u044e\u0448\u043a\u0438 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u043e\u043d\u0442-\u044d\u043d\u0434\u0430.<\/p>\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\/590839\/\"> https:\/\/habr.com\/ru\/articles\/590839\/<\/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><strong>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c React<\/strong><\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/589819\/\" rel=\"noopener noreferrer nofollow\"><u>&lt;&lt; \u0427\u0430\u0441\u0442\u044c 2 \u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 Figma<\/u><\/a><\/p>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0434\u0432\u0443\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u044f \u043e\u043f\u0438\u0441\u0430\u043b, \u043a\u0430\u043a \u0431\u0435\u0437 \u043e\u0441\u043e\u0431\u044b\u0445 \u0443\u0441\u0438\u043b\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f Figma. \u0418 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u043b\u0430\u0433\u0438\u043d, \u044d\u0442\u043e\u0433\u043e \u0437\u043d\u0430\u043d\u0438\u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u041d\u043e \u0432\u043e\u0442 \u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439, \u0447\u0435\u043c \u043f\u0430\u0440\u0430 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0438\u043d\u043f\u0443\u0442\u043e\u0432, \u0435\u0441\u043b\u0438 \u043d\u0430\u0432\u043e\u0440\u043e\u0447\u0435\u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439, \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u0443\u0434\u043e\u0431\u0435\u043d. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043d\u0430\u0434\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0432 html. \u0420\u0435\u0448\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0435\u0433\u043e \u0432\u0435\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e <a href=\"https:\/\/www.figma.com\/plugin-docs\/bundling-react\/\" rel=\"noopener noreferrer nofollow\"><strong><u>React<\/u><\/strong><\/a><strong> <\/strong>\u0438 \u0435\u0433\u043e \u043f\u0440\u0435\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0441\u0442\u0432\u043e <a href=\"https:\/\/www.figma.com\/plugin-docs\/bundling-webpack\/\" rel=\"noopener noreferrer nofollow\"><strong><u>Webpack<\/u><\/strong><\/a>. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u043f\u043b\u0430\u0433\u0438\u043d\u0443 \u043e\u0431\u0435\u0438\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Figma. \u0418 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u0435\u0441\u043b\u0438 \u0431\u044b \u043d\u0435 \u043e\u0434\u043d\u043e \u043d\u043e, \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0410 \u0440\u0430\u0437 \u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e \u043d\u0430 <strong>node <\/strong>\u0432\u0435\u0440\u0441\u0438\u0438 17.1.0 \u0438 <strong>npm<\/strong> \u0432\u0435\u0440\u0441\u0438\u0438 8.1.2<\/p>\n<p>\u0418 \u0442\u0430\u043a, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"javascript\">npm init<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/p>\n<pre><code class=\"javascript\">npm install --save-dev css-loader html-webpack-inline-source-plugin@beta html-webpack-plugin copy-webpack-plugin style-loader file-loader url-loader webpack webpack-cli babel-loader @babel\/preset-env @babel\/preset-react       <\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c react<\/p>\n<pre><code class=\"javascript\">npm install --save react-dom react<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u0430\u043f\u043a\u0443 <strong>src<\/strong> \u0438 \u0432 \u043d\u0435\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u044d\u0442\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 <strong>manifest.json<\/strong><\/p>\n<pre><code class=\"json\">{  \"name\": \"Figma Plugin with React\",  \"api\": \"1.0.0\",  \"main\": \".\/plugin.js\",  \"ui\": \".\/ui.html\",  \"editorType\": [    \"figma\"  ] } <\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0435 \u0442\u043e\u0436\u0435, \u0447\u0442\u043e \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445, \u0441 \u0442\u043e\u0439 \u043b\u0438\u0448\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0435\u0439, \u0447\u0442\u043e \u043f\u0443\u0442\u0438 \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u0430 \u043d\u0435 \u043a\u043e\u0440\u043d\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 <strong>ui.html. <\/strong>\u0412 \u043d\u0435\u0433\u043e \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c body, \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u043f\u043e\u044f\u0441\u043d\u044e \u0437\u0430\u0447\u0435\u043c, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<pre><code class=\"xml\">&lt;body>    &lt;div id=\"figma-plugin-container\">&lt;\/div> &lt;\/body><\/code><\/pre>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0438\u0434\u0435\u0442 <strong>ui.js<\/strong><\/p>\n<pre><code class=\"javascript\">import React from 'react'; import ReactDom from 'react-dom'; import App from '.\/App';  ReactDom.render(    &lt;App \/>,    document.querySelector('#figma-plugin-container') );<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u043c\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c react \u0438 react-dom, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0434\u0443\u043b\u044c App, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043c \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <strong>plugin.js<\/strong> \u043c\u044b \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u043c \u043e\u043a\u043d\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430.<\/p>\n<pre><code class=\"javascript\">figma.showUI (    __html__,    {width: 400, height: 400} );<\/code><\/pre>\n<p>\u0424\u0430\u0439\u043b <strong>App\/index.js <\/strong>\u0438 <strong>App\/module.css<\/strong> \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0442\u043e\u0436\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c\u0438, \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u0445 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0437\u0436\u0435<\/p>\n<p><em>App\/index.js<\/em><\/p>\n<pre><code class=\"javascript\">import React from \"react\";  export default function App() {    return (        &lt;div className=\"App\">                   &lt;\/div>    ) }<\/code><\/pre>\n<p><em>App\/module.css<\/em><\/p>\n<pre><code class=\"css\">body, html {    padding: 0;    margin: 0;    width: 100%;    height: 100%; }  .app {    box-sizing: border-box;    width: 100%;    height: 100%;    padding: 10px; }<\/code><\/pre>\n<p>\u041a\u0430\u0440\u043a\u0430\u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0433\u043e\u0442\u043e\u0432. \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c\u00a0 \u0432 \u043a\u043e\u0440\u043d\u0435 \u0444\u0430\u0439\u043b <strong>webpack.config.js <\/strong>\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"javascript\">const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const path = require('path');  module.exports = (env, argv) => ({    mode: argv.mode === 'production' ? 'production' : 'development',     devtool: argv.mode === 'production' ? false : 'inline-source-map',     entry: {        ui: '.\/src\/ui.js',    },     module: {        rules: [            {                test: \/\\.m?js$\/,                exclude: \/node_modules(?!\\\/ansi-regex)(?!\\\/strip-ansi)\/,                use: {                    loader: 'babel-loader',                    options: {                        presets: [                            '@babel\/preset-env',                            '@babel\/react',                            {                                plugins: ['@babel\/plugin-proposal-class-properties'],                            },                        ],                    },                },            },            { test: \/\\.css$\/, use: ['style-loader', { loader: 'css-loader' }] },            { test: \/\\.(png|jpg|gif|webp|svg)$\/, loader: 'url-loader' },            {                test: \/\\.(png|jpe?g|gif)$\/i,                loader: 'file-loader',            }        ],    },     resolve: {        extensions: ['.jsx', '.js'],        modules: [            path.resolve(__dirname, 'node_modules'),            path.resolve(__dirname, 'src'),            path.resolve(__dirname, ''),        ],    },     output: {        filename: '[name].js',        publicPath: \"\/\",    },     plugins: [        new HtmlWebpackPlugin({            template: \".\/src\/ui.html\",            filename: \"ui.html\",            inlineSource: \".(js)$\",            inject: \"body\",            cache: false,            }),        new HtmlWebpackInlineSourcePlugin(HtmlWebpackPlugin),        new CopyWebpackPlugin({            patterns: [{                from: '.\/src\/plugin.js',                to: '',            }, {                from: '.\/src\/manifest.json',                to: '',            }],        })    ], })<\/code><\/pre>\n<p>\u041d\u0435 \u0441\u0442\u0430\u043d\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0435\u0433\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u0434\u043e\u0443\u043c\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 <a href=\"https:\/\/webpack.js.org\/guides\/\" rel=\"noopener noreferrer nofollow\"><u>\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439<\/u><\/a> webpack. \u041e\u0431\u0440\u0430\u0449\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0443<\/p>\n<pre><code class=\"javascript\">inject: \"body\"<\/code><\/pre>\n<p>\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c <a href=\"https:\/\/www.figma.com\/plugin-docs\/bundling-webpack\/\" rel=\"noopener noreferrer nofollow\"><u>\u0433\u0430\u0439\u0434\u0435<\/u><\/a> Figma \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 HtmlWebpackInlineSourcePlugin. \u0412\u043e\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0441\u044f body \u0432 <strong>ui.html<\/strong>. \u0422\u0443\u0434\u0430 webpack \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 <strong>ui.js<\/strong>.<\/p>\n<p>\u0412\u043e\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0432\u0441\u0435, \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 <strong>package.json<\/strong>\u00a0 \u043f\u0430\u0440\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/p>\n<pre><code class=\"json\">\"scripts\": {    \"start\": \"npx webpack --mode=development --watch\",    \"build\": \"npx webpack --mode=production\" }<\/code><\/pre>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 <strong>start<\/strong> \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u0441\u0431\u043e\u0440\u043a\u0443 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 <strong>development, <\/strong>\u0430 \u0444\u043b\u0430\u0433<strong> -watch <\/strong>\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445. \u0421\u0440\u0438\u043f\u0442 \u0436\u0435 <strong>build<\/strong> \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0431\u043e\u0440\u043a\u0443 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 <strong>production<\/strong>, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u043a \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/p>\n<pre><code class=\"javascript\">npm run start<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043f\u0430\u043f\u043a\u0430 <strong>dist<\/strong> \u0441\u043e \u0441\u0431\u043e\u0440\u043a\u043e\u0439 \u043f\u043b\u0430\u0433\u0438\u043d\u0430. \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u043f\u043b\u0430\u0433\u0438\u043d \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 <strong>manifest.json<\/strong> \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0438, \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u043f\u043b\u0430\u0433\u0438\u043d, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 react.<\/p>\n<p>\u041a\u043e\u0434 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 <a href=\"https:\/\/gitlab.com\/figma-plugin-examples\/figma-plugin-with-react\" rel=\"noopener noreferrer nofollow\"><u>\u0442\u0443\u0442<\/u><\/a>. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e, \u043a\u0430\u043a \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f Figma, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044f \u0432 \u043d\u0435\u043c \u0432\u0441\u0435 \u043f\u043b\u044e\u0448\u043a\u0438 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u043e\u043d\u0442-\u044d\u043d\u0434\u0430.<\/p>\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\/590839\/\"> https:\/\/habr.com\/ru\/articles\/590839\/<\/a><br \/><\/br><\/br><\/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-386321","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/386321","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=386321"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/386321\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=386321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=386321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=386321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}