Example #1
0
 public WebpackService(
     IHostingEnvironment environment,
     ILogger <WebpackService> logger,
     WebpackOptions options)
 {
     _environment = environment;
     _logger      = logger;
     _options     = options;
 }
 public WebpackService(IHostingEnvironment environment,
     ILogger<WebpackService> logger,
     WebpackOptions options)
 {
     _environment = environment;
     _logger = logger;
     _options = options;
     _host = CreateHost(_environment.ContentRootPath);
 }
 public WebpackService(IHostingEnvironment environment,
                       ILogger <WebpackService> logger,
                       WebpackOptions options)
 {
     _environment = environment;
     _logger      = logger;
     _options     = options;
     _host        = CreateHost(_environment.ContentRootPath);
 }
 public WebpackServiceMock()
 {
     _files = new Dictionary<string, IWebpackFile>();
     _options = new WebpackOptions();
     _options.ConfigFile = "webpack.config.js";
     _options.PublicPath = "/webpack/";
     _options.WebRoot = "wwwroot/";
     _options.LogLevel = WebpackLogLevel.Normal;
     _options.Heartbeat = 200;
 }
Example #5
0
 public WebpackService(
     IHostingEnvironment environment,
     ILogger <WebpackService> logger,
     IApplicationLifetime lifetime,
     WebpackOptions options)
 {
     _environment = environment;
     _logger      = logger;
     _options     = options;
     _host        = CreateHost(_environment, lifetime);
 }
        public static void AddWebpack(this IServiceCollection services,
           string configFile = "webpack.config.js",
           string publicPath = "/",
           string webRoot = "wwwroot",
           WebpackLogLevel logLevel = WebpackLogLevel.Normal)
        {
            var options = new WebpackOptions();
            options.ConfigFile = configFile;
            options.PublicPath = publicPath;
            options.WebRoot = webRoot;
            options.LogLevel = logLevel;
            options.Heartbeat = 10000;

            services.AddSingleton<WebpackOptions>(options);
            services.AddSingleton<IWebpackService, WebpackService>();
        }
        public static void AddWebpack(this IServiceCollection services,
                                      string configFile        = "webpack.config.js",
                                      string publicPath        = "/",
                                      string webRoot           = "wwwroot",
                                      WebpackLogLevel logLevel = WebpackLogLevel.Normal)
        {
            var options = new WebpackOptions();

            options.ConfigFile = configFile;
            options.PublicPath = publicPath;
            options.WebRoot    = webRoot;
            options.LogLevel   = logLevel;
            options.Heartbeat  = 10000;

            services.AddSingleton <WebpackOptions>(options);
            services.AddSingleton <IWebpackService, WebpackService>();
        }