Comparing version 1.0.0-gold-1 to 1.0.0-gold-2
{ | ||
"name": "alga-css", | ||
"version": "1.0.0-gold-1", | ||
"version": "1.0.0-gold-2", | ||
"description": "Alga CSS is a scope-first CSS toolkit for quickly mix or compose CSS references and share CSS properties between components", | ||
@@ -37,4 +37,5 @@ "main": "./src/index.js", | ||
"dependencies": { | ||
"chokidar": "^3.5.3", | ||
"glob": "^7.2.0" | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
const chokidar = require('chokidar'); | ||
// Configs | ||
@@ -27,6 +28,15 @@ const preset = require('./configs/preset.js') | ||
config.components = component(options?.src, opts) | ||
if(options?.initialExtraction) { | ||
/*if(options?.initialExtraction) { | ||
config.extract = extraction(options?.extract, {...opts, extract: config.extract}) | ||
} | ||
}*/ | ||
const watcher = chokidar.watch(options?.extract, { | ||
ignored: new RegExp('(^|[/\])..'), | ||
persistent: true | ||
}); | ||
watcher.on('change', path => { | ||
config.extract = extraction(path, {...opts, extract: config.extract}) | ||
}); | ||
if(options?.plugins && Number(options?.plugins.length) >= 1) { | ||
@@ -51,22 +61,2 @@ const newPlugins = options?.plugins.map(item => { | ||
Once (root, {Rule, Declaration, AtRule}) { | ||
/*root.walkAtRules('extract', rule => { | ||
let param = rule.params.trim() | ||
if(param === 'refresh') { | ||
config.extract = extraction(options?.extract, {...opts, extract: config.extract}) | ||
} | ||
else if(param === 'reload') { | ||
config.extract.raws = [] | ||
config.extract = extraction(options?.extract, {...opts, extract: config.extract}) | ||
} | ||
else if(param === 'force') { | ||
config.extract.raws = [] | ||
config.extract = extraction(options?.extract, {...opts, extract: config.extract}) | ||
if(config.extract.rules.length >= 1) { | ||
root.append(...config.extract.rules) | ||
} | ||
} | ||
rule.remove() | ||
})*/ | ||
root.walkAtRules('use', rule => { | ||
@@ -114,2 +104,6 @@ let param = rule.params.trim() | ||
if(config.extract.rules.length >= 1) { | ||
root.append(...config.extract.rules) | ||
} | ||
let newPackNodes = [] | ||
@@ -116,0 +110,0 @@ const filterPackNodes = [] |
121831
2
1525
+ Addedchokidar@^3.5.3
+ Addedanymatch@3.1.3(transitive)
+ Addedbinary-extensions@2.3.0(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedchokidar@3.6.0(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedfsevents@2.3.3(transitive)
+ Addedglob-parent@5.1.2(transitive)
+ Addedis-binary-path@2.1.0(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addednormalize-path@3.0.0(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedreaddirp@3.6.0(transitive)
+ Addedto-regex-range@5.0.1(transitive)