From f7c86cb902c5fe46193c3e32e94e06f22b3a02ed Mon Sep 17 00:00:00 2001 From: Simon Martens Date: Tue, 21 Mar 2023 16:23:03 +0100 Subject: [PATCH] =?UTF-8?q?Vorebereitungen=20zur=20Ver=C3=B6ffentlichung?= =?UTF-8?q?=20I?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eleventy.js | 8 +++++++- .gitignore | 2 +- package.json | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index ea737dd..2ea4f0a 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -158,6 +158,12 @@ module.exports = function (config) { // Set static folder, which copntent will be copied to the output folder config.addPassthroughCopy({ "src/static/": "/static/" }); + // Output directory + var outputdir = "site"; + if (process.env.ELEVENTY_ENVIRONMENT == "production") { + outputdir = "dist"; + } + return { // Set custom directories for dynamic pages, data, includes, layouts and finally the generated output dir: @@ -166,7 +172,7 @@ module.exports = function (config) { layouts: "../layouts", includes: "../includes", data: "../data", - output: "dist" + output: outputdir }, // Set template formats so that other files won't be included in dist diff --git a/.gitignore b/.gitignore index 45aae1b..f4e2ec7 100644 --- a/.gitignore +++ b/.gitignore @@ -104,4 +104,4 @@ dist .tern-port # Eleventy output file -dist/ \ No newline at end of file +site/ \ No newline at end of file diff --git a/package.json b/package.json index 2baf305..a461d17 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "version": "1.0.0", "description": "Test project for 11ty", "scripts": { - "build": "(npx postcss src/static/css/site.css -o src/static/css/output.css; npx @11ty/eleventy)", + "prod_build": "npx postcss src/static/css/site.css -o src/static/css/output.css --verbose && ELEVENTY_ENVIRONMENT=production npx @11ty/eleventy", + "build": "npx postcss src/static/css/site.css -o src/static/css/output.css && npx @11ty/eleventy", "watch": "npx @11ty/eleventy --serve", "css_watch": "npx postcss src/static/css/site.css -o src/static/css/output.css -w --verbose" },