Skip to content

Commit 7ba1e6e

Browse files
committed
chore(site): fix auto-open script & some Nx configuration
1 parent a5e87bf commit 7ba1e6e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/esl-website/11ty/open.postaction.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ import {context} from './env.config.js';
66
* Should be replaced with OOTB solution when https://github.com/11ty/eleventy-dev-server/issues/28 will be resolved
77
*/
88
export default (config) => {
9+
// Should be in serve mode
10+
if (!process.argv.includes('--serve')) return;
11+
// Applicable for clear dev env only
912
if (!context.isDev || context.isE2E) return;
1013
config.on('eleventy.after', async () => {
11-
const { port } = config.serverOptions;
14+
const {port} = config.serverOptions;
1215
if (!port || global.hasOpened) return;
1316
await outUrl.open(`http://localhost:${port}`);
17+
// eslint-disable-next-line require-atomic-updates
1418
global.hasOpened = true;
1519
});
1620
};

packages/esl-website/project.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"executor": "nx:noop",
4848
"dependsOn": [
4949
"esl-website:build:assets",
50-
"esl-website:build:eleventy",
50+
"esl-website:build:eleventy"
5151
]
5252
},
5353
"build:eleventy": {
@@ -59,8 +59,10 @@
5959
"dependsOn": ["^build:docs"],
6060
"cache": true,
6161
"inputs": [
62+
"{projectRoot}/11ty/**/*",
6263
"{projectRoot}/src/**/*",
63-
"{projectRoot}/views/**/*"
64+
"{projectRoot}/views/**/*",
65+
"{projectRoot}/.eleventy.js"
6466
],
6567
"outputs": [
6668
"{projectRoot}/dist/**/*"

0 commit comments

Comments
 (0)