| @import "mithui/css/textInput.css"; | ||
| body { | ||
| background-color: red; | ||
| } |
| @import "./css/subIncluded.css"; |
| .subTest { | ||
| background-color: pink; | ||
| } |
| @import "./css/subIncluded.css"; | ||
| .test { | ||
| background-color: blue; | ||
| } |
| @import "./included.css"; | ||
| body { | ||
| background-color: red; | ||
| } |
+1
-6
@@ -25,9 +25,4 @@ const path = require('path'); | ||
| const absoluteSubPath = resolve.sync(match[1], { | ||
| includeCoreModules: false, | ||
| basedir: relativeSubDirectory | ||
| }); | ||
| const subFile = grabFile(match[1], relativeSubDirectory, '', alreadyIncluded); | ||
| const subFile = grabFile(match[1], path.dirname(absoluteSubPath), '', alreadyIncluded); | ||
| content = content.replace(match[0], subFile); | ||
@@ -34,0 +29,0 @@ } |
+5
-5
| { | ||
| "name": "cssbun", | ||
| "version": "1.2.0", | ||
| "version": "1.2.1", | ||
| "description": "An extremly lightweight bundler than does nothing but bundles your css files using the import syntax.", | ||
@@ -16,5 +16,5 @@ "main": "index.js", | ||
| "dependencies": { | ||
| "chokidar": "^3.5.2", | ||
| "minimist": "^1.2.5", | ||
| "resolve": "^1.20.0" | ||
| "chokidar": "^3.5.3", | ||
| "minimist": "^1.2.7", | ||
| "resolve": "^1.22.1" | ||
| }, | ||
@@ -25,3 +25,3 @@ "directories": { | ||
| "devDependencies": { | ||
| "basictap": "^1.3.1", | ||
| "basictap": "^3.4.3", | ||
| "mithui": "^2.0.9" | ||
@@ -28,0 +28,0 @@ }, |
+46
-0
@@ -36,2 +36,48 @@ const test = require('basictap'); | ||
| test('bundle file from sub directory', t => { | ||
| t.plan(1); | ||
| const result = cssmin('./test/scenarios/subdirectory/index.css'); | ||
| t.equal(result, [ | ||
| '.subTest {', | ||
| ' background-color: pink;', | ||
| '}', | ||
| '', | ||
| '.test {', | ||
| ' background-color: blue;', | ||
| '}', | ||
| '', | ||
| 'body {', | ||
| ' background-color: red;', | ||
| '}' | ||
| ].join('\n')); | ||
| }); | ||
| test('bundle dependency in sub directory', t => { | ||
| t.plan(1); | ||
| const result = cssmin('./test/scenarios/dependencysub/index.css'); | ||
| t.equal(result, [ | ||
| 'mui-text-input input:focus {', | ||
| ' border-color: blue;', | ||
| ' outline: none;', | ||
| '}', | ||
| 'mui-text-input input {', | ||
| ' display: block;', | ||
| ' font-family: arial;', | ||
| ' font-weight: bold;', | ||
| ' font-size: 100%;', | ||
| ' width: 100%;', | ||
| ' border: 2px solid black;', | ||
| ' padding: var(--input-padding);', | ||
| '}', | ||
| '', | ||
| 'body {', | ||
| ' background-color: red;', | ||
| '}' | ||
| ].join('\n')); | ||
| }); | ||
| test('bundle from dependency', t => { | ||
@@ -38,0 +84,0 @@ t.plan(1); |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
10855
10.95%21
31.25%215
31.9%Updated
Updated
Updated