-
|
Say, for example, I want to set the global |
Beta Was this translation helpful? Give feedback.
Answered by
pdehaan
Oct 24, 2022
Replies: 1 comment 1 reply
-
|
Possibly: // src/_data/site.js
const DEFAULT_PORT = process.env.PORT || (process.env.URL && new URL(process.env.URL).port) || 8000;
module.exports = {
url: process.env.URL || `http://localhost:${DEFAULT_PORT}`,
port: DEFAULT_PORT,
};// .eleventy.js
const { port } = require("./src/_data/site");
/**
* @typedef {import('@11ty/eleventy/src/UserConfig')} EleventyConfig
* @typedef {ReturnType<import('@11ty/eleventy/src/defaultConfig')>} EleventyReturnValue
* @type {(eleventyConfig: EleventyConfig) => EleventyReturnValue}
*/
module.exports = function (eleventyConfig) {
eleventyConfig.setServerOptions({ port });
console.log(eleventyConfig.serverOptions);
return {
dir: {
input: "src",
output: "www",
},
};
}; |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ed-ponce
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Possibly: