<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                Sometimes, you'll want to hook your own Gulp tasks into Elixir. Perhaps you have a special bit of functionality that you'd like Elixir to mix and watch for you. No problem! As an example, imagine that you have a general task that simply speaks a bit of text when called. ~~~ gulp.task("speak", function() { var message = "Tea...Earl Grey...Hot"; gulp.src("").pipe(shell("say " + message)); }); ~~~ Easy enough. From the command line, you may, of course, call gulp speak to trigger the task. To add it to Elixir, however, use the mix.task() method: ~~~ elixir(function(mix) { mix.task('speak'); }); ~~~ That's it! Now, each time you run Gulp, your custom "speak" task will be executed alongside any other Elixir tasks that you've mixed in. To additionally register a watcher, so that your custom tasks will be re-triggered each time one or more files are modified, you may pass a regular expression as the second argument. ~~~ elixir(function(mix) { mix.task('speak', 'app/**/*.php'); }); ~~~ By adding this second argument, we've instructed Elixir to re-trigger the "speak" task each time a PHP file in the "app/" directory is saved. For even more flexibility, you can create full Elixir extensions. Using the previous "speak" example, you may write an extension, like so: ~~~ var gulp = require("gulp"); var shell = require("gulp-shell"); var elixir = require("laravel-elixir"); elixir.extend("speak", function(message) { gulp.task("speak", function() { gulp.src("").pipe(shell("say " + message)); }); return this.queueTask("speak"); }); ~~~ 請注意我們 擴增( extend ) Elixir 的 API 時所使用的第一個參數,稍后我們需要在 Gulpfile 中使用它,以及建立 Gulp 任務所使用的回調函數。 如果你想要讓你的自定義任務能被監控,只要在監控器注冊就行了。 `this.registerWatcher("speak", "app/**/*.php");` 這行程序的意思是指,當符合正則表達式 app/**/*.php 的文件一經修改,就會觸發 message 任務。 很好!接著你可以將這行程序寫在 Gulpfile 的頂端,或者將它放到自定義任務的文件里。如果你選擇后者,那么你必須將它加載至你的 Gulpfile,例如: `require("./custom-tasks")` 大功告成!最后你只需要將他們結合。 ~~~ elixir(function(mix) { mix.speak("Tea, Earl Grey, Hot"); }); ~~~ 加入之后,每當你觸發 Gulp,Picard 就會要求一些茶。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看