svelte-preprocess
Advanced tools
Comparing version 4.6.8 to 4.6.9
@@ -0,1 +1,11 @@ | ||
## [4.6.9](https://github.com/sveltejs/svelte-preprocess/compare/v4.6.7...v4.6.9) (2021-02-13) | ||
### Bug Fixes | ||
* 🐛 make markup tag regexp less greedy ([384ba5c](https://github.com/sveltejs/svelte-preprocess/commit/384ba5cad0a2939a2717d9061dd928b4607e1431)), closes [#310](https://github.com/sveltejs/svelte-preprocess/issues/310) | ||
* revert "refactor: use fs/promises" ([3f9572c](https://github.com/sveltejs/svelte-preprocess/commit/3f9572ca30e9a05439a6deddc327fa340dd1ef34)) | ||
## [4.6.8](https://github.com/sveltejs/svelte-preprocess/compare/v4.6.7...v4.6.8) (2021-02-11) | ||
@@ -2,0 +12,0 @@ |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTagInfo = void 0; | ||
const fs_1 = __importStar(require("fs")); | ||
/* eslint-disable node/prefer-promises/fs */ | ||
const fs_1 = require("fs"); | ||
const path_1 = require("path"); | ||
const language_1 = require("./language"); | ||
const utils_1 = require("./utils"); | ||
const { access, readFile } = fs_1.promises; | ||
const resolveSrc = (importerFile, srcPath) => path_1.resolve(path_1.dirname(importerFile), srcPath); | ||
const getSrcContent = (file) => { | ||
return new Promise((resolve, reject) => { | ||
fs_1.readFile(file, (error, data) => { | ||
// istanbul ignore if | ||
if (error) | ||
reject(error); | ||
else | ||
resolve(data.toString()); | ||
}); | ||
}); | ||
}; | ||
async function doesFileExist(file) { | ||
return access(file, fs_1.default.constants.F_OK) | ||
.then(() => true) | ||
.catch(() => false); | ||
return new Promise((resolve) => fs_1.access(file, 0, (err) => resolve(!err))); | ||
} | ||
@@ -49,7 +39,7 @@ const getTagInfo = async ({ attributes, filename, content, }) => { | ||
if (await doesFileExist(path)) { | ||
content = (await readFile(path)).toString(); | ||
content = await getSrcContent(path); | ||
dependencies.push(path); | ||
} | ||
else { | ||
console.warn(`[svelte-preprocess] The file "${path}" was not found.`); | ||
console.warn(`[svelte-preprocess] The file "${path}" was not found.`); | ||
} | ||
@@ -56,0 +46,0 @@ } |
{ | ||
"name": "svelte-preprocess", | ||
"version": "4.6.8", | ||
"version": "4.6.9", | ||
"license": "MIT", | ||
@@ -21,3 +21,3 @@ "main": "dist/index.js", | ||
"engines": { | ||
"node": ">= 10.x" | ||
"node": ">= 9.11.2" | ||
}, | ||
@@ -24,0 +24,0 @@ "files": [ |
@@ -58,3 +58,3 @@ # Svelte Preprocess | ||
Add _vue-like_ support for defining your markup between a `<template>` tag. The tagname can be customized to something like `markup` for example. See [#options](#options). | ||
_Vue-like_ support for defining your markup between a specific tag. The default tag is `template` but it can be [customized](/docs/preprocessing.md#auto-preprocessing-options). | ||
@@ -183,5 +183,3 @@ ```html | ||
<template lang="pug"> | ||
div Posts | ||
+each('posts as post') | ||
a(href="{post.url}") {post.title} | ||
div Posts +each('posts as post') a(href="{post.url}") {post.title} | ||
</template> | ||
@@ -188,0 +186,0 @@ |
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
121481
1794
207