diff --git a/.eleventy.js b/.eleventy.js index 968f91b..6bc93f1 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -14,10 +14,10 @@ function slugify(s) { module.exports = function(eleventyConfig) { const src = process.env.SLATEDIR || 'source'; - eleventyConfig.addPassthroughCopy(src+"/slate/css/*.css"); eleventyConfig.addPassthroughCopy(src+"/slate/js"); eleventyConfig.addPassthroughCopy(src+"/slate/img"); eleventyConfig.addPassthroughCopy(src+"/slate/fonts"); + eleventyConfig.addWatchTarget(src+"/slate/css"); eleventyConfig.addPlugin(syntaxHighlight); eleventyConfig.setLibrary("md", markdownIt({ @@ -26,6 +26,5 @@ module.exports = function(eleventyConfig) { typographer: true }).use(markdownItAnchor, { slugify: slugify - }) - ); + })); }; diff --git a/.gitignore b/.gitignore index 8e202f8..9653887 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ node_modules/ npm-debug.log _site/ source/slate/js/lib/*.min.js -source/slate/css/*.css diff --git a/package.json b/package.json index 194a7ab..eb8dce4 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "lint.ejs": "npx ejs-lint source/_includes/slate.ejs", "make": "npx eleventy --input=source/*.md", "test": "npx mocha", - "build.sass": "npx sass --update --style compressed --no-source-map ./source/slate/css", + "build.sass": "sass --update --style compressed --no-source-map ./source/slate/css:./_site/slate/css", "build.sass.local": "cross-var npx sass --update --style compressed --no-source-map $SLATEDIR/slate/css:$SLATEDIR/slate/css", "build.sass.test": "cross-var npx sass --update --style expanded --no-source-map $SLATEDIR/slate/css:$SLATEDIR/slate/css", "build.11ty": "npx eleventy --input=./source/*.md", @@ -22,6 +22,9 @@ "debug": "DEBUG=Eleventy* npx eleventy --dryrun --input=source/*.md", "serve": "npm run build.sass && npx eleventy --input=source/*.md --serve --port=4567", "serve.local": "cross-var npm run build.sass.local && cross-var npx eleventy --input=$SLATEDIR/*.md --output=$SLATEDIR/_site --serve --port=4567" + "watch:sass": "npm run build.sass -- --watch", + "watch:eleventy": "eleventy --input=source --serve --port=4567", + "start": "npm-run-all --parallel watch:*" }, "keywords": [ "slate", @@ -50,7 +53,8 @@ "shelljs": "^0.8.4" }, "devDependencies": { - "mocha": "^9.0.1" + "mocha": "^9.0.1", + "npm-run-all": "^4.1.5" }, "repository": { "type": "git",