Inheritance: INodeExecutor
        /// <summary>
        /// Default Node compiler configuration, uses nodejs libraries to compile
        /// </summary>
        /// <param name="nodeWorkspacePath">Path to directory where node_modules are installed</param>
        public static ICompilerConfiguration WithDefaultNodeConfiguration(this ICompilerConfiguration compilerConfig, string nodeWorkspacePath, string nodeExePath = null)
        {
            var passthrough = new PassthroughCompiler();
            var executor = new NodeExecutor(nodeWorkspacePath, nodeExePath);

            return compilerConfig
                .CompilerFor(FileExtensions.Coffee, new CoffeeCompiler(executor))
                .CompilerFor(FileExtensions.Js, passthrough)
                .CompilerFor(FileExtensions.Styl, new StylusCompiler(executor, true))
                .CompilerFor(FileExtensions.Less, new LessCompiler(executor))
                .CompilerFor(FileExtensions.Css, passthrough)
                .CompilerFor(FileExtensions.MinJsMin, passthrough) // ignore .min.js files (they are already minified or want to ignore)
                .CompilerFor(FileExtensions.MinCssMin, passthrough) // ignore .min.css files (they are already minified or want to ignore)
                .CompilerFor(FileExtensions.JsMin, new UglifyJSCompiler(executor))
                .CompilerFor(FileExtensions.CssMin, new CssoCompiler(executor));
        }
        /// <summary>
        /// Default Node compiler configuration, uses nodejs libraries to compile
        /// </summary>
        /// <param name="nodeWorkspacePath">Path to directory where node_modules are installed</param>
        public static ICompilerConfiguration WithDefaultNodeConfiguration(this ICompilerConfiguration compilerConfig, string nodeWorkspacePath)
        {
            var passthrough = new PassthroughCompiler();
            var executor = new NodeExecutor(nodeWorkspacePath);

            return compilerConfig
                .CompilerFor(".coffee", new CoffeeCompiler(executor))
                .CompilerFor(".js", passthrough)
                .CompilerFor(".styl", new StylusCompiler(executor, true))
                .CompilerFor(".less", new LessCompiler(executor))
                .CompilerFor(".css", passthrough)
                .CompilerFor(".min.js.min", passthrough) // ignore .min.js files (they are already minified or want to ignore)
                .CompilerFor(".min.css.min", passthrough) // ignore .min.css files (they are already minified or want to ignore)
                .CompilerFor(".js.min", new UglifyJSCompiler(executor))
                .CompilerFor(".css.min", new CssoCompiler(executor));
        }
Example #3
0
 public void Init()
 {
     _executor = new NodeExecutor("../../Node");
 }
 public void Init()
 {
     _executor = new NodeExecutor(TestContext.CurrentContext.TestDirectory + "/../../Node", TestContext.CurrentContext.TestDirectory + "/../../Node/node.exe");
 }