How to use the dustjs-linkedin/lib/dust.optimizers function in dustjs-linkedin

To help you get started, we’ve selected a few dustjs-linkedin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github popeindustries / buddy / packages / buddy-plugin-dust / index.js View on Github external
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();
      });
    }
github popeindustries / buddy / packages / buddy-plugin-dust / src / index.js View on Github external
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();
      });
    }
github popeindustries / buddy / packages / buddy-plugin-dust / index.js View on Github external
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();
      });
    }