{"componentChunkName":"component---src-templates-post-tsx","path":"/posts/2019/12/build-assets-offline/","result":{"data":{"markdownRemark":{"fields":{"slug":"/2019/12/build-assets-offline/"},"frontmatter":{"title":"Building JavaScript assets offline, before deploying to the web server","tag":["JavaScript","Netlify"],"image":null},"correctedDateEpoch":1577206800000,"html":"<p><strong>I have always wondered why I have to run <code>yarn build</code> scripts online on Heroku / Netlify / Now.sh</strong>; which takes time, does not guarantee to succeed and HTML / JavaScript / CSS are cross platform anyway.</p>\n<!-- excerpt_separator -->\n<p>Long time ago, I have found <a href=\"https://www.npmjs.com/package/gh-pages\">gh-pages</a> and wrote a blog about it -- <a href=\"https://www.polvcode.dev/post/2019/08/gh-pages\">https://www.polvcode.dev/post/2019/08/gh-pages</a> -- which is mostly about publishing to GitHub Pages, and Heroku.</p>\n<p>However, there are problems with GitHub Pages; namely, new pages doesn't always update promptly after repeated deployment. There are these kind of problems in Heroku / Netlify / Now.sh.</p>\n<p>Lately, I have one another way for Netlify, which is <a href=\"https://github.com/netlify/cli/blob/master/docs/commands/deploy.md\">Netlify CLI deploy</a>, so I just pust <code>\"deploy\": \"yarn build &#x26;&#x26; netlify deploy --dir dist\"</code> in my <code>package.json</code>. Netlify also offers a way to test a real website online (with hash, so that the name doesn't collide).</p>\n<p>So, back to the real question, <strong>why do I have to run build script for static JavaScript / CSS / HTML assets online</strong>, again?</p>"}},"pageContext":{"slug":"/2019/12/build-assets-offline/"}}}