From 758f7aa8c0458d2d0e9d3aa3568d13d10e81c9b7 Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Wed, 3 Jan 2024 12:31:58 +0100 Subject: [PATCH 1/3] maint(Build): Restrict development server watcher only for files in the src directory. This reduces the number of necessary file watchers and saves important system resources. --- webpack/webpack.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/webpack/webpack.config.js b/webpack/webpack.config.js index 0e6d209e6..2cc812b76 100644 --- a/webpack/webpack.config.js +++ b/webpack/webpack.config.js @@ -83,6 +83,7 @@ module.exports = () => { if (process.env.NODE_ENV === "development") { config.devServer.static.directory = path.resolve(__dirname, "../"); + config.devServer.watchFiles = ["src/"]; // Add a strict Content-Security-Policy without 'unsafe-inline' to the dev // server for testing CSR issues. //config.devServer.headers["Content-Security-Policy"] = From 3882272eccc8465d27d2424ef499d3e97cde6cb4 Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Wed, 3 Jan 2024 17:29:00 +0100 Subject: [PATCH 2/3] maint(Build): Explicitly set the dev server port to 3001 and fix the documentation which was wrong about it. --- README.md | 6 +++++- webpack/webpack.config.js | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3ae937ce2..641f58408 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/webpack/webpack.config.js b/webpack/webpack.config.js index 2cc812b76..cd6ce4479 100644 --- a/webpack/webpack.config.js +++ b/webpack/webpack.config.js @@ -84,6 +84,7 @@ 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"] = From fadd5d4d8be573536049db200dab05b95d1d0109 Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Wed, 23 Oct 2024 07:40:03 +0200 Subject: [PATCH 3/3] maint(Docs): Minor typo in module federation document. --- docs/developer/module-federation.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/developer/module-federation.md b/docs/developer/module-federation.md index 9b3fd3328..8c644de6c 100644 --- a/docs/developer/module-federation.md +++ b/docs/developer/module-federation.md @@ -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"); ``` @@ -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"); ```