Skip to content

Commit 3b9a2b7

Browse files
authored
Merge pull request #600 from OpenKnowledgeMaps/webpack-examples-reload
Improved Webpack hot reloading examples
2 parents f1ca2f9 + f79d8c6 commit 3b9a2b7

5 files changed

Lines changed: 14 additions & 9 deletions

File tree

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Head Start is a web-based knowledge mapping software intended to give researcher
99
### Client
1010
To get started, clone this repository. Next, duplicate the file `config.example.js` in the root folder and rename it to `config.js`.
1111

12-
Make sure to have `npm` version 6.11.3 installed (it comes with Node.js 10.17.0, best way to install is with [nvm](https://github.com/nvm-sh/nvm), `nvm install 10.17.0`) and run the following two commands to build the Headstart client:
12+
Make sure to have installed `node` version >= 14.18.1 and `npm` version >=8.1.1 (best way to install is with [nvm](https://github.com/nvm-sh/nvm), `nvm install 14.18.1`) and run the following two commands to build the Headstart client:
1313

1414
npm install
1515
npm run dev
@@ -24,9 +24,12 @@ To run Headstart on a different server (e.g. Apache), you need to set the public
2424
* Dev: specify the full path including protocol, e.g. `http://localhost/headstart/dist`
2525
* Production: specify the full path excluding protocol, e.g. `//example.org/headstart/dist`
2626

27-
Point your browser to the following address:
27+
Point your browser to one of the following addresses:
2828

29-
http://localhost:8080/examples/local_files/index.html
29+
http://localhost:8080/local_files/
30+
http://localhost:8080/local_streamgraph/
31+
http://localhost:8080/project_website/base.html
32+
http://localhost:8080/project_website/pubmed.html
3033

3134
If everything has worked out, you should see the visualization shown above.
3235

@@ -42,7 +45,7 @@ See [Installing and configuring the server](doc/server_config.md) for instructio
4245

4346
Maintainer: [Peter Kraker](https://github.com/pkraker) ([pkraker@openknowledgemaps.org](mailto:pkraker@openknowledgemaps.org))
4447

45-
Authors: [Maxi Schramm](https://github.com/tanteuschi), [Christopher Kittel](https://github.com/chreman), [Asura Enkhbayar](https://github.com/Bubblbu), [Scott Chamberlain](https://github.com/sckott), [Rainer Bachleitner](https://github.com/rbachleitner), [Yael Stein](https://github.com/jaels), [Thomas Arrow](https://github.com/tarrow), [Mike Skaug](https://github.com/mikeskaug), [Philipp Weissensteiner](https://github.com/wpp), and the [Open Knowledge Maps team](http://openknowledgemaps.org/team)
48+
Authors: [Maxi Schramm](https://github.com/tanteuschi), [Christopher Kittel](https://github.com/chreman), [Jan Konstant](https://github.com/konstiman), [Asura Enkhbayar](https://github.com/Bubblbu), [Scott Chamberlain](https://github.com/sckott), [Rainer Bachleitner](https://github.com/rbachleitner), [Yael Stein](https://github.com/jaels), [Thomas Arrow](https://github.com/tarrow), [Mike Skaug](https://github.com/mikeskaug), [Philipp Weissensteiner](https://github.com/wpp), and the [Open Knowledge Maps team](http://openknowledgemaps.org/team)
4649

4750

4851
## Features

examples/local_streamgraph/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = {
1111

1212
Then the process is the same as with the local files example: start the dev server npm start. When the build is done, the streamgraph can be accessed at
1313

14-
`http://localhost:8080/examples/local_streamgraph/index.html`
14+
`http://localhost:8080/local_streamgraph/`
1515

1616
In future, it might be nice to come up with a solution that doesn't involve config file, but uses for example a system variable or a specific npm run command.
1717

examples/project_website/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33

44
<head>
5-
<base href="//localhost:8080/examples/project_website/">
5+
<base href="//localhost:8080/project_website/">
66

77
<script type="text/javascript" src="./data-config_base.js"></script>
88
<title>

examples/project_website/pubmed.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33

44
<head>
5-
<base href="//localhost:8080/examples/project_website/">
5+
<base href="//localhost:8080/project_website/">
66

77

88
<script type="text/javascript" src="./data-config_pubmed.js"></script>

webpack.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ const common = {
1919
},
2020

2121
devServer: {
22-
static: { directory: path.join( __dirname ) },
22+
static: {
23+
directory: path.resolve(__dirname, 'examples/'),
24+
},
2325
allowedHosts: "all",
2426
host: "0.0.0.0",
25-
devMiddleware: { publicPath: '/dist/' }
27+
devMiddleware: { publicPath: '/dist/' },
2628
},
2729

2830
resolve: {

0 commit comments

Comments
 (0)