ant-app-builder
Advanced tools
Comparing version 1.3.5 to 1.3.6
@@ -204,12 +204,26 @@ | ||
const importFile = async (baseDir, importStr, exclude) => { | ||
let importPath = FS.path.join(baseDir, importStr.slice(9,-1)) | ||
if (!await FS.fileExists(importPath)) return | ||
let importedFile = await FS.readFile(importPath) | ||
let rx = new RegExp(importStr, "im") | ||
data = data.replace(rx, importedFile) | ||
let subImports = data.match(regexp) || [] | ||
if (exclude) { | ||
subImports = subImports.filter(i => exclude.indexOf(i)) | ||
} | ||
if (subImports.length) { | ||
let importDir = FS.path.dirname(importPath) | ||
await Promise.all(subImports.map(async item => importFile(importDir, item, subImports))) | ||
} | ||
} | ||
// find all imports | ||
let regexp = /@import ['"](.+?)['"]/mg | ||
let imports = data.match(regexp) || [] | ||
// loop all requires | ||
await Promise.all(imports.map(async item => importFile(dirPath, item))) | ||
await Promise.all(imports.map(async item => { | ||
let importPath = FS.path.join(dirPath, item.slice(9,-1)) | ||
let importFile = await FS.readFile(importPath) | ||
let rx = new RegExp(item, "im") | ||
data = data.replace(rx, importFile) | ||
})) | ||
data = data.replace(/@store ['"](.+?)['"]/mg, "") | ||
@@ -216,0 +230,0 @@ data = data.replace(/(url\('?)\~/g, `$1/app/${namespace}/${id}`) |
{ | ||
"name": "ant-app-builder", | ||
"version": "1.3.5", | ||
"version": "1.3.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib", |
@@ -5,3 +5,3 @@ | ||
let srcDir = path.join(__dirname, "temp/chess") | ||
let srcDir = path.join(__dirname, "temp/preferences") | ||
let destDir = path.join(__dirname, "temp/_build") | ||
@@ -8,0 +8,0 @@ let uglify = false |
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
51217
406