<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Swashata Ghosh</title>
    <description>The latest articles on DEV Community by Swashata Ghosh (@swashata).</description>
    <link>https://dev.to/swashata</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F85450%2Fd034e528-6954-45f1-b08c-892128507da1.jpeg</url>
      <title>DEV Community: Swashata Ghosh</title>
      <link>https://dev.to/swashata</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/swashata"/>
    <language>en</language>
    <item>
      <title>Setup PHP PCOV for 5 times faster PHPUnit code coverage</title>
      <dc:creator>Swashata Ghosh</dc:creator>
      <pubDate>Fri, 08 Nov 2019 15:06:48 +0000</pubDate>
      <link>https://dev.to/swashata/setup-php-pcov-for-5-times-faster-phpunit-code-coverage-3d9c</link>
      <guid>https://dev.to/swashata/setup-php-pcov-for-5-times-faster-phpunit-code-coverage-3d9c</guid>
      <description>&lt;p&gt;I am a WordPress developer, and my daily tasks involves writing lots of PHP code. In my latest project, I am making a GraphQL server right inside WordPress and of course it involves testing.&lt;/p&gt;

&lt;p&gt;For code-coverage, I use XDebug and while it works, it is painfully slow. In our GitLab CI, it takes over 30 minutes to run a complete coverage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F089z4qflm84yxwzpuofi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F089z4qflm84yxwzpuofi.png" alt="PHPUnit Coverage with XDebug"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter &lt;a href="https://github.com/krakjoe/pcov" rel="noopener noreferrer"&gt;PHP PCOV&lt;/a&gt;. After a complete setup, our tests finish in a little over 6 minutes. It is 5 times faster than before. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F18mssbf35uzmjge3u55y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F18mssbf35uzmjge3u55y.png" alt="PHPUnit Coverage with PCOV"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that you might feel convinced, let's dive in how we did that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Installation
&lt;/h2&gt;

&lt;p&gt;We need the PCOV extension installed and XDebug extension completely disabled. To install PCOV run&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

pecl &lt;span class="nb"&gt;install &lt;/span&gt;pcov


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The above would work on most Linux and MacOS systems. If you are using official PHP docker images, then run&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

pecl &lt;span class="nb"&gt;install &lt;/span&gt;pcov &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; docker-php-ext-enable pcov


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Make sure to remove XDebug as well. On docker, simply don't install XDebug extension. On other system, edit &lt;code&gt;php.ini&lt;/code&gt; file and remove or comment the line with &lt;code&gt;extension="xdebug.so"&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Clobber PHPUnit version 7 or less
&lt;/h2&gt;

&lt;p&gt;PCOV has built-in support for PHPUnit version 8 or greater. But I am stuck with PHPUnit 7, because I need the full WordPress testing library which currently works only with PHPUnit 7. Luckily &lt;a href="https://blog.krakjoe.ninja/" rel="noopener noreferrer"&gt;Joe Watkins&lt;/a&gt; the same person who made PCOV has also made a package called &lt;a href="https://github.com/krakjoe/pcov-clobber" rel="noopener noreferrer"&gt;PCOV Clobber&lt;/a&gt;, for exactly this.&lt;/p&gt;

&lt;p&gt;At this point, I am assuming you are using PHPUnit as a composer dependency. So run&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

composer require pcov/clobber &lt;span class="nt"&gt;--dev&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;followed by&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

vendor/bin/pcov clobber


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This will make changes to the existing files inside &lt;code&gt;vendor&lt;/code&gt; directory to make XDebug drive use PCOV instead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: You have to run this command every-time you update any composer package.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Run PHPUnit with PCOV
&lt;/h2&gt;

&lt;p&gt;Now at this point, if you simply run&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

./vendor/bin/phpunit


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;chances are, you will be given empty code coverage (unless your source files are inside &lt;code&gt;src&lt;/code&gt;, &lt;code&gt;lib&lt;/code&gt; or &lt;code&gt;app&lt;/code&gt; directory. So we have to make changes to some configuration variable while running PHPUnit. Simply run the following command and it should just work&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

php &lt;span class="nt"&gt;-dpcov&lt;/span&gt;.enabled&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="nt"&gt;-dpcov&lt;/span&gt;.directory&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-dpcov&lt;/span&gt;.exclude&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"~vendor~"&lt;/span&gt; ./vendor/bin/phpunit &lt;span class="nt"&gt;--coverage-text&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Thanks to Ahmet Bora at &lt;a href="https://github.com/krakjoe/pcov/issues/34" rel="noopener noreferrer"&gt;this github issue&lt;/a&gt; to figure this out. Here's what's happening&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;pcov.enabled=1&lt;/code&gt; - Enable PCOV support.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pcov.directory=.&lt;/code&gt; - Get coverage for all files in current directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pcov.exclude="~vendor~"&lt;/code&gt; - Exclude coverage for &lt;code&gt;vendor&lt;/code&gt; directory.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bonus: GitLab CI Configuration
&lt;/h2&gt;

&lt;p&gt;Since we run our tests mostly in CI, and we use &lt;a href="https://gitlab.com" rel="noopener noreferrer"&gt;GitLab&lt;/a&gt;, here's how our &lt;code&gt;.gitlab-ci.yml&lt;/code&gt; file looks like.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;

&lt;span class="na"&gt;test:php73&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;stage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;test&lt;/span&gt;
  &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;wordpress&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;registry.gitlab.com/wpquark/docker-containers/php-node:2.0.0-php-7.3-node-12.13.0&lt;/span&gt;
  &lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;mariadb:10.3&lt;/span&gt;
  &lt;span class="na"&gt;before_script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;yarn install --frozen-lockfile&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;composer install&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;vendor/bin/pcov clobber&lt;/span&gt;
  &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# - yarn phpunit&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;php -dpcov.enabled=1 -dpcov.directory=. -dpcov.exclude="~vendor~" ./vendor/bin/phpunit --configuration=phpunit.ci.xml --testdox&lt;/span&gt;
  &lt;span class="na"&gt;artifacts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;coverage/phpunit&lt;/span&gt;
    &lt;span class="na"&gt;expire_in&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;2 days&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The thing to notice is we do &lt;code&gt;vendor/bin/pcov clobber&lt;/code&gt; before running the &lt;code&gt;phpunit&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;Also here's the content of &lt;code&gt;phpunit.ci.xml&lt;/code&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;

&lt;span class="cp"&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;phpunit&lt;/span&gt;
    &lt;span class="na"&gt;bootstrap=&lt;/span&gt;&lt;span class="s"&gt;"tests/bootstrap.php"&lt;/span&gt;
    &lt;span class="na"&gt;backupGlobals=&lt;/span&gt;&lt;span class="s"&gt;"false"&lt;/span&gt;
    &lt;span class="na"&gt;colors=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;
    &lt;span class="na"&gt;convertErrorsToExceptions=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;
    &lt;span class="na"&gt;convertNoticesToExceptions=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;
    &lt;span class="na"&gt;convertWarningsToExceptions=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;
    &lt;span class="na"&gt;verbose=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;testsuites&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;testsuite&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Unit Tests"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;directory&lt;/span&gt; &lt;span class="na"&gt;suffix=&lt;/span&gt;&lt;span class="s"&gt;"Test.php"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;./tests/Unit/*&lt;span class="nt"&gt;&amp;lt;/directory&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/testsuite&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;testsuite&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Integration Tests"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;directory&lt;/span&gt; &lt;span class="na"&gt;suffix=&lt;/span&gt;&lt;span class="s"&gt;"Test.php"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;./tests/Integration/*&lt;span class="nt"&gt;&amp;lt;/directory&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/testsuite&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;testsuite&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"GraphQL Tests"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;directory&lt;/span&gt; &lt;span class="na"&gt;suffix=&lt;/span&gt;&lt;span class="s"&gt;"Test.php"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;./tests/GraphQL/*&lt;span class="nt"&gt;&amp;lt;/directory&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/testsuite&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/testsuites&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;filter&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;whitelist&lt;/span&gt; &lt;span class="na"&gt;processUncoveredFilesFromWhitelist=&lt;/span&gt;&lt;span class="s"&gt;"false"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;directory&lt;/span&gt; &lt;span class="na"&gt;suffix=&lt;/span&gt;&lt;span class="s"&gt;".php"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;./inc&lt;span class="nt"&gt;&amp;lt;/directory&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;exclude&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;directory&lt;/span&gt; &lt;span class="na"&gt;suffix=&lt;/span&gt;&lt;span class="s"&gt;".php"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;./inc/System&lt;span class="nt"&gt;&amp;lt;/directory&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;directory&lt;/span&gt; &lt;span class="na"&gt;suffix=&lt;/span&gt;&lt;span class="s"&gt;".php"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;./inc/View&lt;span class="nt"&gt;&amp;lt;/directory&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/exclude&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/whitelist&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/filter&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;logging&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;log&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"coverage-text"&lt;/span&gt; &lt;span class="na"&gt;target=&lt;/span&gt;&lt;span class="s"&gt;"php://stdout"&lt;/span&gt; &lt;span class="na"&gt;showUncoveredFiles=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;log&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"coverage-clover"&lt;/span&gt; &lt;span class="na"&gt;target=&lt;/span&gt;&lt;span class="s"&gt;"coverage/phpunit/clover.xml"&lt;/span&gt; &lt;span class="na"&gt;showUncoveredFiles=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;log&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"coverage-html"&lt;/span&gt; &lt;span class="na"&gt;target=&lt;/span&gt;&lt;span class="s"&gt;"coverage/phpunit/html"&lt;/span&gt; &lt;span class="na"&gt;lowUpperBound=&lt;/span&gt;&lt;span class="s"&gt;"35"&lt;/span&gt; &lt;span class="na"&gt;highLowerBound=&lt;/span&gt;&lt;span class="s"&gt;"70"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/logging&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/phpunit&amp;gt;&lt;/span&gt;



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;I hope you will give PCOV a try. Also give a huge shout-out to &lt;a href="https://twitter.com/krakjoe" rel="noopener noreferrer"&gt;@krakjoe&lt;/a&gt; who made all these things possible.&lt;/p&gt;

</description>
      <category>php</category>
      <category>xdebug</category>
      <category>pcov</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>react-scripts (CRA) like tooling for WordPress</title>
      <dc:creator>Swashata Ghosh</dc:creator>
      <pubDate>Mon, 08 Oct 2018 14:06:40 +0000</pubDate>
      <link>https://dev.to/swashata/react-scripts-cra-like-tooling-for-wordpress-33jp</link>
      <guid>https://dev.to/swashata/react-scripts-cra-like-tooling-for-wordpress-33jp</guid>
      <description>&lt;p&gt;Hello everyone,&lt;/p&gt;

&lt;p&gt;This is my first post here and I would like to share a tooling I have been developing over past 2 weeks, which I believe would give a better Development Experience for WordPress developers.&lt;/p&gt;

&lt;p&gt;Being a traditional WordPress developer myself, I know it can be a pain to setup all those webpack stuff for every new projects. On top of, if we were to leverage the advanced code-splitting of webpack, then somehow, we would need to enqueue all chunks in the entrypoint, set &lt;code&gt;dynamicPublicPath&lt;/code&gt; for lazy loading (&lt;code&gt;import('').then()&lt;/code&gt;) etc.&lt;/p&gt;

&lt;p&gt;To make things easier, I came up with an idea of abstracting the build tooling inside one single scripts (much like &lt;code&gt;react-scripts&lt;/code&gt;). This is the outcome so far.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/8M8kCKnWIfY"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;And this is the repo.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/swashata" rel="noopener noreferrer"&gt;
        swashata
      &lt;/a&gt; / &lt;a href="https://github.com/swashata/wp-webpack-script" rel="noopener noreferrer"&gt;
        wp-webpack-script
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      💥🔥📦👩‍💻 An easy to use, pre configured, hackable webpack setup &amp;amp; development server for WordPress themes and plugins.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;
  &lt;a href="https://wpack.io" rel="nofollow noopener noreferrer"&gt;&lt;img width="600" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fswashata%2Fwp-webpack-script%2Fmaster%2Fassets%2Fwpackio-logo.png"&gt;&lt;/a&gt;&lt;br&gt;
  visit our website &lt;a href="https://wpack.io" rel="nofollow noopener noreferrer"&gt;wpack.io&lt;/a&gt; for documentation and usage
&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;wpack.io - Modern JavaScript tooling for WordPress&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;&lt;a href="https://github.com/swashata/wp-webpack-script#backers" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/ffe5324cef5ae98fff7f35e32837601dd56e86c0e69630a4cfe4cbfaab0bc760/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f777061636b696f2f6261636b6572732f62616467652e737667" alt="Backers on Open Collective"&gt;&lt;/a&gt; &lt;a href="https://github.com/swashata/wp-webpack-script#sponsors" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/30421d9500e6df67617f6e51b5793867a5e03b5460a1b8295e9e7a55b7794059/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f777061636b696f2f73706f6e736f72732f62616467652e737667" alt="Sponsors on Open Collective"&gt;&lt;/a&gt; &lt;a href="https://travis-ci.com/swashata/wp-webpack-script" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/fa097d4402916cce4e1794d5d31ea1fc238594cb0fe7d3f37ebb9c0b47aebc36/68747470733a2f2f7472617669732d63692e636f6d2f73776173686174612f77702d7765627061636b2d7363726970742e7376673f6272616e63683d6d6173746572" alt="Build Status"&gt;&lt;/a&gt; &lt;a href="https://codecov.io/gh/swashata/wp-webpack-script" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/ded20ea19665b07a0cb8102f8957ebecaa61516b91df117bb9160e130ff3eb39/68747470733a2f2f636f6465636f762e696f2f67682f73776173686174612f77702d7765627061636b2d7363726970742f6272616e63682f6d61737465722f67726170682f62616467652e737667" alt="codecov"&gt;&lt;/a&gt; &lt;a href="https://badge.fury.io/js/%40wpackio%2Fscripts" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/62b78396051ccf66be68f64244f931add98ed9bc54e261a385c1d6c07cccfc43/68747470733a2f2f62616467652e667572792e696f2f6a732f253430777061636b696f253246736372697074732e737667" alt="npm version"&gt;&lt;/a&gt; &lt;a href="https://www.npmjs.com/package/@wpackio/scripts" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/9066825bc63ab256aca8aa1c5c2f8027ef174142c7862a8cd576df86150b3412/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f64742f40777061636b696f2f736372697074732e7376673f6c6162656c3d646f776e6c6f616473" alt="npm download"&gt;&lt;/a&gt; &lt;a href="https://dashboard.cypress.io/#/projects/r3p1vm/runs" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/11673b4fbc13008e50196ec53d30f4d30dec4c5f4241134eee2e78fbb9787d0b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f637970726573732d64617368626f6172642d627269676874677265656e2e737667" alt="cypress dashboard"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;What is wpack.io?&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;Put simply, wpack.io is a nodejs based build tool to ease up using modern javascript
in WordPress Themes and Plugins. It gives a fine &lt;em&gt;Developer Experience&lt;/em&gt; (DX) and
a single dependency for all your bundling requirement.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It is a fine-tuned webpack/browser-sync configuration made specifically for
WordPress Theme and Plugin Development.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With the rise of Gutenberg editor, the usage of modern JavaScript and libraries
like react is imminent. The goal of this tooling is to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;✅ Provide out of the box compiling and bundling of all front-end assets.&lt;/li&gt;
&lt;li&gt;✅ Give best in class Developer Experience (DX)
&lt;ul&gt;
&lt;li&gt;Hot Module Replacement and Live Reload.&lt;/li&gt;
&lt;li&gt;Compile files on save.&lt;/li&gt;
&lt;li&gt;Work on any local development server.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;✅ Support modern and useful concepts like modules, tree-shaking, dynamic import etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;and eliminate the pain points such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;❌ Boilerplate…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/swashata/wp-webpack-script" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Some of the features are:&lt;/p&gt;

&lt;p&gt;👉 Supports Hot Reloading, right out of the box.&lt;br&gt;
👉 Dynamic PublicPath, generated by a WP based PHP class, so use import(), code-splitting all you want.&lt;br&gt;
👉 Can work with any local server (vvv, wamp, mamp, docker).&lt;br&gt;
👉 Webpack Multi-Compiler support.&lt;br&gt;
👉 Hybrid of Browsersync and webpack dev and hot middleware, finest DX.&lt;br&gt;
👉 Zero-config, ES6+, reactjs, Sass, typescript support.&lt;/p&gt;

&lt;p&gt;I request, if you are interested in WordPress development, please give this a try. I have not published yet, so you would need to clone it (a bit of pain) and run the example.&lt;/p&gt;

&lt;p&gt;You would need to have &lt;code&gt;docker&lt;/code&gt; and preferably &lt;code&gt;yarn&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone git@github.com:swashata/wp-webpack-script.git
yarn
yarn build
&lt;span class="nb"&gt;cd &lt;/span&gt;examples/plugin
docker-compose up &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; docker-compose logs &lt;span class="nt"&gt;-f&lt;/span&gt; wordpress
yarn exstart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I would very much like to have feedbacks before I finish up the first version 😃.&lt;/p&gt;

</description>
      <category>webpack</category>
      <category>javascript</category>
      <category>wordpress</category>
    </item>
  </channel>
</rss>
