<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="71338" data-post-id="71338">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="antalvarenga" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/antalvarenga/120/6049_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  antalvarenga
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m more on the side of learning rather than forgetting things <img src="https://forum.elixirforum.com/images/emoji/apple/sweat_smile.png?v=15" title=":sweat_smile:" class="emoji" alt=":sweat_smile:" loading="lazy" width="20" height="20"><br>
Changed the build pipeline to run babel instead of uglify (i don’t want it minified on dev mode anyway).<br>
Same result (though not minified anymore) <img src="https://forum.elixirforum.com/images/emoji/apple/confused.png?v=15" title=":confused:" class="emoji" alt=":confused:" loading="lazy" width="20" height="20">.<br>
<a href="https://github.com/antalvarenga/build_test/blob/master/priv/static/js/app.js" rel="noopener nofollow ugc">app.js</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="71338" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-setup-a-phoenix-1-3-app-with-gulp-npm-scripts/12618/8">Post #7</a>
	                </div>
	            </div>
              <div id="likers-container-71338" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="71338"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #7"></div>
  </section>
</div>
    <div class="postbit" id="71331" data-post-id="71331">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><span class="mention">@antalvarenda</span> You aren’t processing your javascript through babel(?) or so, probably forgot that step?  <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
<p>EDIT:  Yep, you are only running it through a minimizer but aren’t processing the ES6 to ES5 via whatever it was called.  <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="71331" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-setup-a-phoenix-1-3-app-with-gulp-npm-scripts/12618/7">Post #6</a>
	                </div>
	            </div>
              <div id="likers-container-71331" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="71331"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #6"></div>
  </section>
</div>
    <div class="postbit" id="71329" data-post-id="71329">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="antalvarenga" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/antalvarenga/120/6049_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  antalvarenga
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks <a class="mention" href="/u/peerreynders" rel="nofollow">@peerreynders</a>, <a class="mention" href="/u/amnu3387" rel="nofollow">@amnu3387</a>.</p>
<p>I kinda took on <a class="mention" href="/u/peerreynders" rel="nofollow">@peerreynders</a> advice and gave a try on npm scripts. I created a new phoenix project with brunch and then removed the brunch-config.js file and brunch dependencies (seems to be the most used approach to change the build tool).</p>
<p>Everything seems to be working, except for the js part. The built app.js file (on priv/static) on a “normal” phoenix project has a bunch of code coming from require.js, module-definitions.js, phoenix.js, phoenix_html.js, socket.js. Right now <em>my</em>  built app.js has only the “import “phoenix_html”” statement (which is not recognized) and the socket.js code (<a href="https://github.com/antalvarenga/build_test/blob/master/priv/static/js/app.js" rel="noopener nofollow ugc">Here is the repo of the phoenix app</a>).</p>
<p>How should I deal with the javascript files, so that i can have all the default functionality that comes with phoenix?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="71329" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-setup-a-phoenix-1-3-app-with-gulp-npm-scripts/12618/6">Post #5</a>
	                </div>
	            </div>
              <div id="likers-container-71329" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="71329"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #5"></div>
  </section>
</div>
    <div class="postbit" id="70870" data-post-id="70870">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="amnu3387" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  amnu3387
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I never used gulp so I don’t really know, but I recently changed brunch to webpack and it was sort of straightforward following some <a href="http://pggalaviz.com/2017/05/28/phoenix-vue-and-webpack/" rel="noopener nofollow ugc">tutorials</a> (scss &amp; assets the most annoying stuff - I can share my webpack.config if you want).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70870" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-setup-a-phoenix-1-3-app-with-gulp-npm-scripts/12618/5">Post #4</a>
	                </div>
	            </div>
              <div id="likers-container-70870" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70870"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #4"></div>
  </section>
</div>
    <div class="postbit" id="70843" data-post-id="70843">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="peerreynders" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/120/5826_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  peerreynders
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<ul>
<li>Brunch and Webpack are module bundlers. As such they have an opinion about the build process but by and large they are configured rather than scripted. In Webpack’s case things get a bit blurry because configurations are often assembled in a scripted manner.</li>
<li>Gulp is a task runner and as such sees itself as taking the place of npm scripts. So to bundle modules it still has to use a bundler plugin such as Browserify which often can be done simply in npm itself. Gulp has more advanced facilities than npm scripts for coordinating build tasks - but from what I’ve seen it isn’t really <em>configured</em> as much as it is being scripted by writing Gulp tasks. One issue is that often in cases where Gulp seems simpler it really isn’t necessary (<a href="https://medium.freecodecamp.org/why-i-left-gulp-and-grunt-for-npm-scripts-3d6853dd22b8" rel="noopener nofollow ugc">Why I Left Gulp and Grunt for npm Scripts (2016-Jan-17)</a>).</li>
</ul>
<p><a href="https://medium.com/the-node-js-collection/modern-javascript-explained-for-dinosaurs-f695e9747b70" rel="noopener nofollow ugc">Modern JavaScript for Dinosaurs</a> gives an overview of using npm scripts and Webpack (see also <a href="https://medium.com/@gimenete/how-javascript-bundlers-work-1fc0d0caf2da" rel="noopener nofollow ugc">How JavaScript bundlers work</a>).</p>
<p>Aside: Here is an example where <a href="https://github.com/stoyan/reactbook/tree/master/whinepad3/scripts" rel="noopener nofollow ugc">simple shell scripts</a> are used to build a simple react application with <a href="https://www.npmjs.com/package/browserify" rel="noopener nofollow ugc">browserify</a>, <a href="https://www.npmjs.com/package/babel-cli" rel="noopener nofollow ugc">babel-cli</a>, <a href="https://www.npmjs.com/package/watch" rel="noopener nofollow ugc">watch</a>, and <a href="https://www.npmjs.com/package/uglify" rel="noopener nofollow ugc">uglify</a>, <a href="https://www.npmjs.com/package/cssshrink" rel="noopener nofollow ugc">cssshrink</a>, <a href="https://www.npmjs.com/package/jest-cli" rel="noopener nofollow ugc">jest-cli</a>, <a href="https://www.npmjs.com/package/babel-jest" rel="noopener nofollow ugc">babel-jest</a>, <a href="https://www.npmjs.com/package/react-addons-test-utils" rel="noopener nofollow ugc">react-addons-test-utils</a>, <a href="https://www.npmjs.com/package/eslint" rel="noopener nofollow ugc">eslint</a>, <a href="https://www.npmjs.com/package/eslint-plugin-react" rel="noopener nofollow ugc">eslint-plugin-react</a>, <a href="https://www.npmjs.com/package/eslint-plugin-babel" rel="noopener nofollow ugc">eslint-plugin-babel</a>, and <a href="https://www.npmjs.com/package/flow-bin" rel="noopener nofollow ugc">flow-bin</a>.</p>
<p>Now I don’t know whether that is the case here but I think often people try to choose a build tool before they fully understand the <em>build process</em>. I’m not saying that npm scripts are the be all and end all but they are likely the best way to get acquainted with the <em>build process</em> and as such can be pushed quite a ways. Once the build process is better understood and one’s needs are much clearer it should be easier to pick the right tool, be it <a href="https://webpack.js.org/" rel="noopener nofollow ugc">webpack</a> (<a href="https://survivejs.com/webpack/preface/" rel="noopener nofollow ugc">SurviveJS - webpack</a>), <a href="https://parceljs.org/" rel="noopener nofollow ugc">parcel</a>, <a href="https://rollupjs.org/" rel="noopener nofollow ugc">rollup.js</a> or whatever.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70843" data-batch-url="/posts/batch_likers">
                        5
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-setup-a-phoenix-1-3-app-with-gulp-npm-scripts/12618/4">Post #3</a>
	                </div>
	            </div>
              <div id="likers-container-70843" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70843"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #3"></div>
  </section>
</div>
    <div class="postbit" id="70839" data-post-id="70839">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="antalvarenga" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/antalvarenga/120/6049_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  antalvarenga
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Gulp seems simpler to configure</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70839" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-setup-a-phoenix-1-3-app-with-gulp-npm-scripts/12618/3">Post #2</a>
	                </div>
	            </div>
              <div id="likers-container-70839" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70839"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #2"></div>
  </section>
</div>
    <div class="postbit" id="70772" data-post-id="70772">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="amnu3387" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  amnu3387
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Why not Webpack?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70772" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-setup-a-phoenix-1-3-app-with-gulp-npm-scripts/12618/2">Post #1</a>
	                </div>
	            </div>
              <div id="likers-container-70772" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70772"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-first-post cat-first-post" title="First post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>