# Script for running a webpack build on localhost

**URL:** https://forum.kirupa.com/t/script-for-running-a-webpack-build-on-localhost/637972
**Category:** web dev
**Created:** [March 23, 2018, 10:16pm UTC](https://forum.kirupa.com/t/script-for-running-a-webpack-build-on-localhost/637972 "2018-03-23T22:16:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kgraham5225](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kgraham5225/32/9035_2.png) [@kgraham5225](https://forum.kirupa.com/u/kgraham5225)
#### Post date: [March 23, 2018, 10:16pm UTC](https://forum.kirupa.com/t/script-for-running-a-webpack-build-on-localhost/637972/1 "2018-03-23T22:16:19Z")

</div>

Hey, I’m new around.

I wanted to ask a question and see if anyone knew.

I am currently working on shifting a project, it was originally react code built by webpack and run through spring boot in tomcat. I am changing it to be a pure npm/webpack/react app by trying to script it for localhost running.

I have a build.js and an index.html in resources after my webpack build. How do I write a script in my package.json to start these?

Thanks

---

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [March 24, 2018, 4:38am UTC](https://forum.kirupa.com/t/script-for-running-a-webpack-build-on-localhost/637972/2 "2018-03-24T04:38:42Z")

</div>

Welcome! One thing you can do is look at [create-react-app](https://github.com/facebook/create-react-app) and see how they have their **package.json** defined 🙂

---

<div class="post-metadata">

### Author: ![kgraham5225](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kgraham5225/32/9035_2.png) [@kgraham5225](https://forum.kirupa.com/u/kgraham5225)
#### Post date: [March 26, 2018, 4:55pm UTC](https://forum.kirupa.com/t/script-for-running-a-webpack-build-on-localhost/637972/3 "2018-03-26T16:55:47Z")

</div>

I’ve been looking through that and other seeds, so far the start scripts have only run the webpack dev server not the actually built code I have.

Most of these seeds use react-scripts with require you to have your environment set up in a certain way.
