Ejemplo n.º 1
0
        public ISmidgeRequire RequiresJs(JavaScriptFile file)
        {
            if (_type == WebFileType.Css)
                throw new InvalidOperationException("Cannot add css file to a js bundle");
            if (FileSystemHelper.IsExternalRequestPath(file.FilePath))
                throw new InvalidOperationException("Cannot process an external file as part of a bundle");

            _bundleManager.AddToBundle(_bundleName, file);
            return this;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds an item to the bundle, if the bundle doesn't exist it will be created
 /// </summary>
 /// <param name="bundleName"></param>
 /// <param name="file"></param>
 public void AddToBundle(string bundleName, JavaScriptFile file)
 {
     BundleFileCollection collection;
     if (_bundles.TryGetValue(bundleName, out collection))
     {
         collection.Files.Add(file);
     }
     else
     {
         _bundles.Create(bundleName, file);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds an item to the bundle, if the bundle doesn't exist it will be created
 /// </summary>
 /// <param name="bundleName"></param>
 /// <param name="file"></param>
 public void AddToBundle(string bundleName, JavaScriptFile file)
 {
     List<IWebFile> files;
     if (_bundles.TryGetValue(bundleName, out files))
     {
         files.Add(file);
     }
     else
     {
         _bundles.Create(bundleName, file);
     }
 }
Ejemplo n.º 4
0
 public ISmidgeRequire RequiresJs(JavaScriptFile file)
 {
     _context.Files.Add(file);
     return this;
 }
Ejemplo n.º 5
0
 public ISmidgeRequire RequiresJs(JavaScriptFile file)
 {
     return this;
 }