private JavaScriptSource GenerateSource()
        {
            IAssemblySource  generatedSource = _codeGenerator.ExecutePlugins(_plugins, "/*", "*/", null);
            JavaScriptSource assemblySource  = new JavaScriptSource
            {
                GeneratedCode        = generatedSource.GeneratedCode,
                RegisteredReferences = generatedSource.RegisteredReferences
            };

            return(assemblySource);
        }
        public void Generate()
        {
            var sw = Stopwatch.StartNew();
            JavaScriptSource jsSource = GenerateSource();

            var compressor = new JavaScriptCompressor();

            jsSource.GeneratedCode = Regex.Replace(jsSource.GeneratedCode, detectLineTag, "\n");
            jsSource.GeneratedCode = Regex.Replace(jsSource.GeneratedCode, detectTag, "");
            var minifiedString = compressor.Compress(jsSource.GeneratedCode);


            var outFileStream = File.Create(Path.Combine(Paths.GeneratedFolder, OutputFile));
            var modelBytes    = new UTF8Encoding(true).GetBytes(minifiedString);

            outFileStream.Write(modelBytes, 0, modelBytes.Length);
            outFileStream.Close();
        }