carrot-css
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -5,16 +5,14 @@ const pluginSass = require("eleventy-plugin-sass") | ||
const moment = require("moment") | ||
const { fstat } = require("fs") | ||
module.exports = function (eleventyConfig) { | ||
// design images | ||
// eleventyConfig.addPassthroughCopy({ public: 'public' }) | ||
// eleventyConfig.addPassthroughCopy('_dist') | ||
// eleventyConfig.addCollection('sortedGallery', function (collectionApi) { | ||
// return collectionApi.getFilteredByTag('gallery').sort(function (a, b) { | ||
// return b.data.date - a.data.date | ||
// }) | ||
// }) | ||
eleventyConfig.addPlugin(pluginSass, { | ||
watch: ["css/*.css", "css/*.scss", "css/**/*.css", "css/**/*.scss"], | ||
watch: [ | ||
"css/*.css", | ||
"css/*.scss", | ||
"css/**/*.css", | ||
"css/**/*.scss", | ||
"docs/css/*.scss", | ||
"docs/css/*.css", | ||
], | ||
sourcemaps: true, | ||
@@ -24,23 +22,11 @@ outputDir: "docs/_site/css/", | ||
eleventyConfig.addWatchTarget("css") | ||
eleventyConfig.addWatchTarget("*.njk") | ||
eleventyConfig.addWatchTarget("./css/") | ||
// eleventyConfig.addWatchTarget("**.njk") | ||
// eleventyConfig.addWatchTarget("**.html") | ||
// eleventyConfig.addWatchTarget("**.md") | ||
eleventyConfig.addWatchTarget("docs/index.html") | ||
eleventyConfig.addWatchTarget("docs/test.njk") | ||
eleventyConfig.addFilter("console", function (value) { | ||
return util.inspect(value) | ||
}) | ||
// eleventyConfig.addFilter('console', function (value) { | ||
// return util.inspect(value) | ||
// }) | ||
// eleventyConfig.addFilter('getPageBySlug', function (collection, slug) { | ||
// let item = collection.find(function (item) { | ||
// return item.data.page.fileSlug == slug | ||
// }) | ||
// return item ? item.data : null | ||
// }) | ||
// eleventyConfig.addFilter('formatDate', function (date) { | ||
// return moment(date).format('DD.MM.YYYY') | ||
// }) | ||
return { | ||
@@ -53,4 +39,4 @@ dir: { | ||
}, | ||
templateFormats: ["html", "njk"], | ||
templateFormats: ["html", "njk", "md"], | ||
} | ||
} |
@@ -27,4 +27,4 @@ const chalk = require("chalk") | ||
} else if (args[0] == "compile") { | ||
compileCSS("_dist/carrot-css.css") | ||
compileCSS("_dist/carrot-css.min.css", true) | ||
compileCSS("css/carrot.scss", "dist/carrot.css") | ||
compileCSS("css/carrot.scss", "dist/carrot.min.css", true) | ||
} else { | ||
@@ -31,0 +31,0 @@ console.log( |
{ | ||
"name": "carrot-css", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "A simple CSS starter, that assume as less as possible", | ||
"main": "index.js", | ||
"main": "./dist/carrot.css", | ||
"style": "./dist/carrot.css", | ||
"author": "Tom Quinonero <tomquinonero@hey.com>", | ||
@@ -21,2 +22,3 @@ "license": "MIT", | ||
"figlet": "^1.5.0", | ||
"filesize": "^6.1.0", | ||
"minimist": "^1.2.5", | ||
@@ -23,0 +25,0 @@ "modern-css-reset": "^1.4.0", |
var fs = require("fs") | ||
const chalk = require("chalk") | ||
var filesize = require("filesize") | ||
@@ -8,5 +9,5 @@ const sass = require("sass") | ||
module.exports = (outputPath, minimize = false) => { | ||
module.exports = (inputPath, outputPath, minimize = false) => { | ||
var result = sass.renderSync({ | ||
file: "css/main.scss", | ||
file: inputPath, | ||
outputStyle: minimize ? "compressed" : "expanded", | ||
@@ -25,5 +26,16 @@ }) | ||
console.log(chalk.green(`🎉 G O O D N E W S 🎉\n`)) | ||
console.log(chalk.green(`🎉 CSS built under ${outputPath}\n\n\n`)) | ||
console.log(chalk.green(`🎉 CSS built under ${outputPath}\n`)) | ||
const stats = fs.statSync(outputPath) | ||
const fileSizeInKb = filesize(stats.size, { round: 0 }) | ||
// we write the building size in a file to be displayed in the documentation | ||
console.log(chalk.green(`File size: ${fileSizeInKb}\n\n\n\n`)) | ||
if (minimize) { | ||
fs.writeFile( | ||
"./docs/_data/libSize.json", | ||
`{"libSize": "${fileSizeInKb}"}`, | ||
() => {} | ||
) | ||
} | ||
}) | ||
}) | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61
1119
157270
15
4
1