Skip to content

Commit

Permalink
Merge pull request #1216 from Patternslib/thet-improvements--devserver
Browse files Browse the repository at this point in the history
Thet improvements  devserver
  • Loading branch information
thet authored Jan 7, 2025
2 parents 3191eba + fadd5d4 commit 606e2ec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ which contains Patterns and all its dependencies:

Alternatively, you can [download a bundle at patternslib.com](http://patternslib.com/download.html).

To start the development server, use `make serve` or `npx yarn start` and access the demo pages via [http://localhost:3001/](http://localhost:3001/).
The files are watched and the bundle re-built on changes.
You can access the bundle directly at [http://localhost:3001/bundle.min.js](http://localhost:3001/bundle.min.js).


## Layout

Expand All @@ -70,7 +74,7 @@ You'll need to have a Sass compiler installed.
To demo the patterns, simply type `make serve` to install the necessary
dependencies and to start a simple Node.js HTTP server.

You can then visit http://localhost:4001 to see a site with demos.
You can then visit http://localhost:3001 to see a site with demos.

Alternatively, patterns can also be demoed through the
[Patternslib.com](http://patternslib.com) website, which is open-source. The
Expand Down
8 changes: 4 additions & 4 deletions docs/developer/module-federation.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ For jQuery the remote bundle is named ``jquery-remote.min.js``.

```
import "@patternslib/patternslib/webpack/module_federation";
// Please not the parentheses for the next import.
// Kepp them, otherwise we get this error:
// Please note the parentheses for the next import.
// Keep them, otherwise we get this error:
// "Shared module is not available for eager consumption."
import("./src/patterns");
```
Expand All @@ -39,8 +39,8 @@ For the jQuery bundle which we will use as remote we create: ``index-jquery.js``

```
import "@patternslib/patternslib/webpack/module_federation";
// Please not the parentheses for the next import.
// Kepp them, otherwise we get this error:
// Please note the parentheses for the next import.
// Keep them, otherwise we get this error:
// "Shared module is not available for eager consumption."
import("@patternslib/patternslib/src/globals");
```
Expand Down
2 changes: 2 additions & 0 deletions webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ module.exports = () => {

if (process.env.NODE_ENV === "development") {
config.devServer.static.directory = path.resolve(__dirname, "../");
config.devServer.watchFiles = ["src/"];
config.devServer.port = "3001";
// Add a strict Content-Security-Policy without 'unsafe-inline' to the dev
// server for testing CSR issues.
//config.devServer.headers["Content-Security-Policy"] =
Expand Down

0 comments on commit 606e2ec

Please sign in to comment.