久久久久久久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 進行生產(chǎn)

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

            <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 進行生產(chǎn)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在嘗試使用 gulp 瀏覽我的 react 應(yīng)用程序以進行生產(chǎn),并 envify 設(shè)置 NODE_ENV.所以我可以刪除反應(yīng)警告,控制臺中的錯誤報告,甚至我的代碼來禁用一些功能,比如 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.

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

                  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 選項卡,就像我在開發(fā)網(wǎng)站上一樣.如何在 chrome 的開發(fā)工具中禁用此選項卡?

                  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 任務(wù):

                  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');
                      }));
                  };
                  

                  推薦答案

                  根據(jù) 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>
                  

                  然后,您可以考慮將其與您的環(huán)境條件一起包裝,就像您可以在服務(wù)器端渲染中執(zhí)行以下操作一樣.比方說哈巴狗(以前稱為 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(){}" : ""}
                  

                  但是,將業(yè)務(wù)邏輯和敏感數(shù)據(jù)放回您的服務(wù)器仍然是一個好習(xí)慣.

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

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

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

                  相關(guān)文檔推薦

                  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?(是否可以將標(biāo)志傳遞給 Gulp 以使其以不同的方式運行任務(wù)?)
                  Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                  How to run Gulp tasks sequentially one after the other(如何一個接一個地依次運行 Gulp 任務(wù))
                  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>
                            主站蜘蛛池模板: 国产成人精品一区二区三区视频 | 蜜桃久久 | 欧美二三区 | 欧美日本在线观看 | 91在线一区二区 | 亚洲欧美日韩高清 | 九九亚洲| 亚洲一区二区在线免费观看 | 精品亚洲一区二区三区 | 天天精品在线 | 亚洲一区不卡在线 | 久久成人一区二区三区 | 日韩精品不卡 | 成人看片在线观看 | 国产乱码久久久久久 | 99精品一区二区 | 欧美精品一区二区三区四区五区 | 一呦二呦三呦国产精品 | 日韩精品在线观看一区二区三区 | 亚洲精品二区 | 精品国产一区二区 | 久久久久一区二区三区四区 | 欧美极品视频 | 亚洲精品一区av在线播放 | 欧产日产国产精品视频 | 中文字幕第一页在线 | 91视视频在线观看入口直接观看 | 亚洲欧美精| 国产精久久久久久久妇剪断 | 一区二区三区四区在线视频 | 一区二区视屏 | 亚洲一区二区精品视频在线观看 | h片免费在线观看 | 国产精品三级 | 国产精品国产精品 | 国产三区视频在线观看 | 亚洲第一视频网站 | 另类亚洲视频 | 免费精品久久久久久中文字幕 | 欧美二三区 | 91在线观看免费视频 |