hero-patterns
Advanced tools
Comparing version 1.0.2 to 1.1.0
{ | ||
"name": "hero-patterns", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "Patterns from heropatterns.com exported as ES6 functions", | ||
"main": "index.js", | ||
"main": "hero-patterns.js", | ||
"scripts": { | ||
@@ -46,2 +46,3 @@ "start": "yarn run browser_sync & NODE_ENV=development nodemon --exec 'yarn run test && yarn run build && browser-sync reload'", | ||
"rollup": "^0.41.6", | ||
"rollup-plugin-alias": "^1.2.1", | ||
"rollup-plugin-babel": "^2.7.1", | ||
@@ -48,0 +49,0 @@ "rollup-plugin-babili": "^2.0.0", |
import resolve from 'rollup-plugin-node-resolve' | ||
import commonjs from 'rollup-plugin-commonjs' | ||
import json from 'rollup-plugin-json' | ||
import alias from 'rollup-plugin-alias' | ||
import babel from 'rollup-plugin-babel' | ||
import babili from 'rollup-plugin-babili' | ||
import fs from 'fs-extra' | ||
import combo from 'random-a11y-combo' | ||
import * as hero from './hero-patterns' | ||
// Do some preprocessing to make sure the build goes right. | ||
// Kind of gross to do it here, | ||
// but that's sort of what Rollup is for, right? | ||
// To build the site? | ||
// delete 'dist', so that copying the index.html works | ||
@@ -14,4 +22,20 @@ if (fs.existsSync('dist')) fs.emptyDirSync('dist') | ||
fs.copySync('./site/index.html', './dist/index.html') | ||
// pre-generate color combinations | ||
// this can make the build hang but speeds up the site tremendously | ||
let combos = [] | ||
let num = process.env.NODE_ENV === 'production' ? Object.keys(hero).length * 10 : 69 | ||
for (let i = num; i--;) { | ||
combos.push(combo()) | ||
} | ||
fs.outputJsonSync('./dist/combos.json', combos) | ||
// OK now on to the actual Rollup stuff | ||
let plugs = [ | ||
alias({ | ||
resolve: ['.js', '.json'], | ||
combos: './../dist/combos', | ||
'package.json': './../package', | ||
'hero-patterns': './../hero-patterns' | ||
}), | ||
resolve({ | ||
@@ -18,0 +42,0 @@ main: true, |
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
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
480422
1373
0
35
3