久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<i id='GLR4L'><tr id='GLR4L'><dt id='GLR4L'><q id='GLR4L'><span id='GLR4L'><b id='GLR4L'><form id='GLR4L'><ins id='GLR4L'></ins><ul id='GLR4L'></ul><sub id='GLR4L'></sub></form><legend id='GLR4L'></legend><bdo id='GLR4L'><pre id='GLR4L'><center id='GLR4L'></center></pre></bdo></b><th id='GLR4L'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='GLR4L'><tfoot id='GLR4L'></tfoot><dl id='GLR4L'><fieldset id='GLR4L'></fieldset></dl></div>
    <legend id='GLR4L'><style id='GLR4L'><dir id='GLR4L'><q id='GLR4L'></q></dir></style></legend>

    <small id='GLR4L'></small><noframes id='GLR4L'>

    1. <tfoot id='GLR4L'></tfoot>

        <bdo id='GLR4L'></bdo><ul id='GLR4L'></ul>

        禁用 chrome react DevTools 進行生產

        Disable chrome react DevTools for production(禁用 chrome react DevTools 進行生產)

            <legend id='Nf70O'><style id='Nf70O'><dir id='Nf70O'><q id='Nf70O'></q></dir></style></legend>
            <i id='Nf70O'><tr id='Nf70O'><dt id='Nf70O'><q id='Nf70O'><span id='Nf70O'><b id='Nf70O'><form id='Nf70O'><ins id='Nf70O'></ins><ul id='Nf70O'></ul><sub id='Nf70O'></sub></form><legend id='Nf70O'></legend><bdo id='Nf70O'><pre id='Nf70O'><center id='Nf70O'></center></pre></bdo></b><th id='Nf70O'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Nf70O'><tfoot id='Nf70O'></tfoot><dl id='Nf70O'><fieldset id='Nf70O'></fieldset></dl></div>
              <tbody id='Nf70O'></tbody>
                <tfoot id='Nf70O'></tfoot>
              1. <small id='Nf70O'></small><noframes id='Nf70O'>

                • <bdo id='Nf70O'></bdo><ul id='Nf70O'></ul>

                  本文介紹了禁用 chrome react DevTools 進行生產的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在嘗試使用 gulp 瀏覽我的 react 應用程序以進行生產,并 envify 設置 NODE_ENV.所以我可以刪除反應警告,控制臺中的錯誤報告,甚至我的代碼來禁用一些功能,比如 react-addons-perf 的要求.

                  I'm trying to browserify my react app for production using gulp and envify to setup NODE_ENV. So I can remove react warning, error reporting in the console, and even my code to disable some features like the require of react-addons-perf.

                  而且效果很好.當我在我的 app.js 中搜索生產"以查看是否存在這些典型條件時:

                  And it's working great. When I search in my app.js for "production" to see if there are theses typical conditions :

                  if("development" !== "production") {
                      ...
                  }
                  

                  什么都沒有,所以,正如我所說,它似乎運作良好.

                  There is nothing, so, as I said, it seems to work well.

                  但是,我仍然可以看到帶有所有 react 組件的 chrome 的 react DevTools 選項卡,就像我在開發網站上一樣.如何在 chrome 的開發工具中禁用此選項卡?

                  But, I still can see that chrome's react DevTools tab with all react components, like if I was on a development website. How can I disable this tab in chrome's dev tools ?

                  這是我的 gulp 任務:

                  Here is my gulp task :

                  var production  = process.env.NODE_ENV === 'production' ? true : false;
                  var environment = process.env.NODE_ENV ? process.env.NODE_ENV : 'dev';
                  
                  ...
                  
                  var bundler = browserify({
                      debug: !production,
                  
                      // These options are just for Watchify
                      cache: {}, packageCache: {}, fullPaths: true
                  })
                  .require(require.resolve('./dev/client/main.js'), { entry: true })
                  .transform(envify({global: true, _: 'purge', NODE_ENV: environment}), {global: true})
                  .transform(babelify)
                  .transform(reactify);
                  
                  var start = Date.now();
                  bundler.bundle()
                      .on('error', function (err) {
                          console.log(err.toString());
                          this.emit("end");
                      })
                      .pipe(source('main.js'))
                      .pipe(gulpif(options.uglify, streamify(uglify())))
                      .pipe(gulpif(!options.debug, streamify(stripDebug())))
                      .pipe(gulp.dest(options.dest))
                      .pipe(notify(function () {
                          console.log('Built in ' + (Date.now() - start) + 'ms');
                      }));
                  };
                  

                  推薦答案

                  根據 Github 上的一個問題,你可以在 react 加載前添加 run 單行 javascript 來防止它.

                  According to an issue on Github, you can add run a single javascript line before react is loaded to prevent it.

                  來自 #191 of react-devtools

                  <script>
                  window.__REACT_DEVTOOLS_GLOBAL_HOOK__.inject = function () {}
                  </script>
                  

                  然后,您可以考慮將其與您的環境條件一起包裝,就像您可以在服務器端渲染中執行以下操作一樣.比方說哈巴狗(以前稱為 Jade):

                  Then, you may consider wrapping this with your environment condition, like that you could do sth like below in your server side rendering. Let's say Pug (formerly known as Jade):

                  #{process.env.NODE_ENV == 'production' ? "window.__REACT_DEVTOOLS_GLOBAL_HOOK__.inject = function(){}" : ""}
                  

                  但是,將業務邏輯和敏感數據放回您的服務器仍然是一個好習慣.

                  However, it would be still a good practice to put the business logic and the sensitive data back to your server.

                  這篇關于禁用 chrome react DevTools 進行生產的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browserify, Babel 6, Gulp - Unexpected token on spread operator(Browserify,Babel 6,Gulp - 傳播運算符上的意外令牌)
                  Is it possible to pass a flag to Gulp to have it run tasks in different ways?(是否可以將標志傳遞給 Gulp 以使其以不同的方式運行任務?)
                  Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                  How to run Gulp tasks sequentially one after the other(如何一個接一個地依次運行 Gulp 任務)
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時 Visual Studio 2015 崩潰)
                  Detect FLASH plugin crashes(檢測 FLASH 插件崩潰)
                      <bdo id='edCiC'></bdo><ul id='edCiC'></ul>
                      <legend id='edCiC'><style id='edCiC'><dir id='edCiC'><q id='edCiC'></q></dir></style></legend>

                      <tfoot id='edCiC'></tfoot>

                      <small id='edCiC'></small><noframes id='edCiC'>

                    • <i id='edCiC'><tr id='edCiC'><dt id='edCiC'><q id='edCiC'><span id='edCiC'><b id='edCiC'><form id='edCiC'><ins id='edCiC'></ins><ul id='edCiC'></ul><sub id='edCiC'></sub></form><legend id='edCiC'></legend><bdo id='edCiC'><pre id='edCiC'><center id='edCiC'></center></pre></bdo></b><th id='edCiC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='edCiC'><tfoot id='edCiC'></tfoot><dl id='edCiC'><fieldset id='edCiC'></fieldset></dl></div>

                          <tbody id='edCiC'></tbody>
                            主站蜘蛛池模板: 久久99精品视频 | 97精品超碰一区二区三区 | 日韩在线免费 | 国精产品一品二品国精在线观看 | 欧美视频一区二区三区 | 欧美日韩中文字幕 | 亚洲欧美日韩中文字幕一区二区三区 | 国产精品久久久久久福利一牛影视 | 热99| 伊人伊成久久人综合网站 | 久在线视频播放免费视频 | 2022国产精品 | 毛片网在线观看 | 天天天插 | 国产精品久久久久一区二区三区 | 亚洲中午字幕 | 亚洲成人av在线 | 日韩中文在线视频 | 国产精品美女一区二区 | 超碰97免费观看 | 亚洲一二三区精品 | 欧美亚洲国产一区二区三区 | 亚洲vs天堂 | 一区二区三区电影网 | 中文字幕在线播放第一页 | 久草在线在线精品观看 | 中文字幕第一页在线 | 中文av字幕| 欧美手机在线 | 97人人澡人人爽91综合色 | 国产亚洲精品精品国产亚洲综合 | 在线播放一区 | 亚洲精品黄色 | 国产成人精品午夜 | 综合激情久久 | 欧美日韩亚洲在线 | 91小视频| 久久久久久网站 | 欧美午夜精品 | 亚洲国产精品久久久久婷婷老年 | 日本三级在线视频 |