Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
inline: false,
prev: false
};
}
const postcssResult = await postcss([
autoprefixer()
]).process(sassResult.css, postcssOptions);
const result: CssBuildResult = {
css: postcssResult.css
};
if (this.variables.sourceMap && sassResult.map && postcssResult.map) {
const sm2 = postcssResult.map.toJSON();
const abs = upath.resolve(upath.dirname(virtualPostcssOutputPath), sm2.sources[0]);
// console.log(abs);
sm2.sources[0] = '/' + upath.relative(this.variables.root, abs);
// console.log(sm2.sources);
// console.log(sm2.file);
result.map = mergeSourceMap(sassResult.map, sm2);
/*
=> Found "merge-source-map@1.1.0"
info Reasons this module exists
- Hoisted from "vue-loader#@vue#component-compiler-utils#merge-source-map"
*/
}
return result;
}
replaceString: manifestString,
searchString: options.injectionPoint,
});
filesToWrite[options.swDest] = source;
filesToWrite[sourcemapDestPath] = map;
} else {
// If there's no sourcemap associated with swSrc, a simple string
// replacement will suffice.
filesToWrite[options.swDest] = swFileContents.replace(
globalRegexp, manifestString);
}
for (const [file, contents] of Object.entries(filesToWrite)) {
try {
await fse.mkdirp(upath.dirname(file));
} catch (error) {
throw new Error(errors['unable-to-make-injection-directory'] +
` '${error.message}'`);
}
await fse.writeFile(file, contents);
}
return {
count,
size,
warnings,
filePaths: Object.keys(filesToWrite),
};
}
function getPackageMainDir(packagePath) {
var packageJson = getPackageJson(packagePath);
if (!packageJson) {
console.error('Unable to read the file: ' + packagePath);
return null;
}
var packageMain = packageJson.aurelia && packageJson.aurelia.main && packageJson.aurelia.main['native-modules'] || packageJson.main || packageJson.browser;
return packageMain ? path.dirname(path.join(packagePath, packageMain)) : null;
}
render(context, done) {
let output
if (this.isStylus) {
output = stylus(this.input)
.set('filename', this.path.full)
.set('paths', [path.dirname(this.path.full)])
.render()
return done(null, output)
}
return done(null, this.input)
}
function replaceExt(npath, ext) {
if (typeof npath !== 'string') {
return npath;
}
if (npath.length === 0) {
return npath;
}
const nFileName = Path.basename(npath, pathCompleteExtname(npath)) + ext;
return Path.join(Path.dirname(npath), nFileName);
}
}
let compileConfig = await qx.tool.config.Compile.getInstance().load();
let qxpath = false;
let appPath = await this.getApplicationPath();
let libraries = compileConfig.getValue("libraries");
if (libraries) {
for (let somepath of libraries) {
let manifestPath = somepath;
if (!path.isAbsolute(somepath)) {
manifestPath = path.join(appPath, manifestPath);
}
manifestPath = path.join(manifestPath, qx.tool.config.Manifest.config.fileName);
let manifest = await qx.tool.utils.Json.loadJsonAsync(manifestPath);
try {
if (manifest.provides && manifest.provides.namespace === "qx") {
qxpath = path.dirname(manifestPath);
return qxpath;
}
} catch (e) {
qx.tool.compiler.Console.warn(`Invalid manifest file ${manifestPath}.`);
}
}
}
return this.getGlobalQxPath();
},
removeFilesInDirectory: filePath => {
fs.unlinkSync(filePath);
let folder = upath.dirname(filePath);
while (fs.readdirSync(folder).length === 0) {
fs.rmdirSync(folder);
folder = upath.parse(folder).dir;
}
},