boxwood 0.61.5 → 0.62.0
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/index.js +14 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const { join } = require('path')
|
|
2
|
+
const { readFileSync } = require('fs')
|
|
1
3
|
const csstree = require('css-tree')
|
|
2
4
|
const toHash = require('string-hash')
|
|
3
5
|
|
|
@@ -258,6 +260,12 @@ function css(inputs) {
|
|
|
258
260
|
}
|
|
259
261
|
}
|
|
260
262
|
|
|
263
|
+
css.load = function () {
|
|
264
|
+
const path = join(...arguments)
|
|
265
|
+
const content = readFileSync(path, 'utf8')
|
|
266
|
+
return css`${content}`
|
|
267
|
+
}
|
|
268
|
+
|
|
261
269
|
function js(inputs) {
|
|
262
270
|
let result = ''
|
|
263
271
|
for (let i = 0, ilen = inputs.length; i < ilen; i += 1) {
|
|
@@ -274,6 +282,12 @@ function js(inputs) {
|
|
|
274
282
|
}
|
|
275
283
|
}
|
|
276
284
|
|
|
285
|
+
js.load = function () {
|
|
286
|
+
const path = join(...arguments)
|
|
287
|
+
const content = readFileSync(path, 'utf8')
|
|
288
|
+
return js`${content}`
|
|
289
|
+
}
|
|
290
|
+
|
|
277
291
|
const node = (name) => (options, children) => tag(name, options, children)
|
|
278
292
|
const doctype = node('!DOCTYPE html')
|
|
279
293
|
|