Vorebereitungen zur Veröffentlichung I

This commit is contained in:
Simon Martens
2023-03-21 16:23:03 +01:00
parent b297ceb8e7
commit f7c86cb902
3 changed files with 10 additions and 3 deletions

View File

@@ -158,6 +158,12 @@ module.exports = function (config) {
// Set static folder, which copntent will be copied to the output folder // Set static folder, which copntent will be copied to the output folder
config.addPassthroughCopy({ "src/static/": "/static/" }); config.addPassthroughCopy({ "src/static/": "/static/" });
// Output directory
var outputdir = "site";
if (process.env.ELEVENTY_ENVIRONMENT == "production") {
outputdir = "dist";
}
return { return {
// Set custom directories for dynamic pages, data, includes, layouts and finally the generated output // Set custom directories for dynamic pages, data, includes, layouts and finally the generated output
dir: dir:
@@ -166,7 +172,7 @@ module.exports = function (config) {
layouts: "../layouts", layouts: "../layouts",
includes: "../includes", includes: "../includes",
data: "../data", data: "../data",
output: "dist" output: outputdir
}, },
// Set template formats so that other files won't be included in dist // Set template formats so that other files won't be included in dist

2
.gitignore vendored
View File

@@ -104,4 +104,4 @@ dist
.tern-port .tern-port
# Eleventy output file # Eleventy output file
dist/ site/

View File

@@ -3,7 +3,8 @@
"version": "1.0.0", "version": "1.0.0",
"description": "Test project for 11ty", "description": "Test project for 11ty",
"scripts": { "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", "watch": "npx @11ty/eleventy --serve",
"css_watch": "npx postcss src/static/css/site.css -o src/static/css/output.css -w --verbose" "css_watch": "npx postcss src/static/css/site.css -o src/static/css/output.css -w --verbose"
}, },