vaderjs 1.3.3-alpha-91 → 1.3.3-alpha-92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/vader.js +14 -4
package/package.json
CHANGED
package/vader.js
CHANGED
|
@@ -576,6 +576,9 @@ function Compiler(func, file) {
|
|
|
576
576
|
|
|
577
577
|
break;
|
|
578
578
|
case path && path.includes('module.css'):
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
579
582
|
let css = await fs.readFileSync(process.cwd() + path, 'utf8')
|
|
580
583
|
css = css.replaceAll('.', '')
|
|
581
584
|
|
|
@@ -618,6 +621,15 @@ function Compiler(func, file) {
|
|
|
618
621
|
let name = match.split('import')[1].split('from')[0].trim()
|
|
619
622
|
|
|
620
623
|
path = path.replace(/'/g, '').trim().replace(/"/g, '').trim()
|
|
624
|
+
let deep = path.split('/').length - 1
|
|
625
|
+
for (let i = 0; i < deep; i++) {
|
|
626
|
+
path = path.split('../').join('')
|
|
627
|
+
path = path.split('./').join('')
|
|
628
|
+
}
|
|
629
|
+
path = path.replace(/'/g, '').trim().replace(/"/g, '').trim()
|
|
630
|
+
// remove double / from path
|
|
631
|
+
path = path.split('//').join('/')
|
|
632
|
+
|
|
621
633
|
switch (true) {
|
|
622
634
|
case path && path.includes('json'):
|
|
623
635
|
path = path.replace(';', '')
|
|
@@ -628,8 +640,7 @@ function Compiler(func, file) {
|
|
|
628
640
|
|
|
629
641
|
path = path.replace(';', '')
|
|
630
642
|
path = path.replace(/'/g, '').trim().replace(/"/g, '').trim()
|
|
631
|
-
path = path.replaceAll('.jsx', '.js');
|
|
632
|
-
path = path.replaceAll('../', '');
|
|
643
|
+
path = path.replaceAll('.jsx', '.js');
|
|
633
644
|
|
|
634
645
|
let css = fs.readFileSync(process.cwd() + '/' + path, 'utf8')
|
|
635
646
|
|
|
@@ -637,8 +648,7 @@ function Compiler(func, file) {
|
|
|
637
648
|
newImport = `let ${name} = ${JSON.stringify(parse(css))}`
|
|
638
649
|
string = string.replace(beforeimport, newImport)
|
|
639
650
|
break;
|
|
640
|
-
case path && path.endsWith('.css'):
|
|
641
|
-
console.log(path)
|
|
651
|
+
case path && path.endsWith('.css'):
|
|
642
652
|
string = string.replace(beforeimport, '')
|
|
643
653
|
newImport = ``
|
|
644
654
|
break;
|