Browse Source

Configures webpackDevServer to allow hosting with gitpod.

pull/305/head
nisarhassan12 6 years ago
parent
commit
5cf6fc78ce
  1. 3
      .gitpod.yml
  2. 4
      README.md
  3. 3
      scripts/webpack.config.dev.js

3
.gitpod.yml

@ -1,6 +1,7 @@
tasks: tasks:
- command: gp await-port 3000 && gp preview $(gp url 3000)/examples/browser/demo.html
- init: npm install - init: npm install
command: npm start command: npm start
ports: ports:
- port: 3000 - port: 3000
onOpen: open-preview onOpen: ignore

4
README.md

@ -105,6 +105,10 @@ npm start
The development server will be available at http://localhost:3000/examples/browser/demo.html in your favorite browser. The development server will be available at http://localhost:3000/examples/browser/demo.html in your favorite browser.
It will automatically rebuild `tesseract.dev.js` and `worker.min.js` when you change files in the src folder. It will automatically rebuild `tesseract.dev.js` and `worker.min.js` when you change files in the src folder.
You can also run the development server in Gitpod ( a free online IDE and dev environment for GitHub ) with a single click.
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/naptha/tesseract.js/blob/master/examples/browser/demo.html)
### Building Static Files ### Building Static Files
To build the compiled static files just execute the following: To build the compiled static files just execute the following:
```shell ```shell

3
scripts/webpack.config.dev.js

@ -20,6 +20,9 @@ const genConfig = ({
}, },
}), }),
], ],
devServer: {
allowedHosts: ['localhost', '.gitpod.io'],
},
}); });
module.exports = [ module.exports = [

Loading…
Cancel
Save