Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
compile (buildOptions, fn) {
// Keep whitespace
dust.optimizers.format = (ctx, node) => node;
// Precompile and load
const source = dust.compile(this.string.toString(), this.filepath);
dust.loadSource(source);
dust.render(this.filepath, this.findSidecarDependency(), (err, content) => {
if (err) {
if (!this.options.runtimeOptions.watch) return fn(err);
error(err, 4, false);
}
this.string = new MagicString(content);
debug(`compile: ${strong(this.relpath)}`, 4);
fn();
});
}
compile (buildOptions, fn) {
// Keep whitespace
dust.optimizers.format = (ctx, node) => node;
// Precompile and load
const source = dust.compile(this.content, this.filepath);
dust.loadSource(source);
dust.render(this.filepath, this.findSidecarDependency(), (err, content) => {
if (err) {
if (!this.options.runtimeOptions.watch) return fn(err);
error(err, 4, false);
}
this.setContent(content);
debug(`compile: ${strong(this.relpath)}`, 4);
fn();
});
}
compile (buildOptions, fn) {
// Keep whitespace
dust.optimizers.format = (ctx, node) => node;
// Precompile and load
const source = dust.compile(this.content, this.filepath);
dust.loadSource(source);
dust.render(this.filepath, this.findSidecarDependency(), (err, content) => {
if (err) return fn(err);
this.content = content;
debug(`compile: ${strong(this.relpath)}`, 4);
fn();
});
}