mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: updateimport () and []array
This commit is contained in:
@@ -3,11 +3,9 @@ module assets
|
||||
// this module provides an AssetManager for combining
|
||||
// and caching javascript & css.
|
||||
|
||||
import (
|
||||
os
|
||||
time
|
||||
crypto.md5
|
||||
)
|
||||
import os
|
||||
import time
|
||||
import crypto.md5
|
||||
|
||||
const (
|
||||
UnknownAssetTypeError = 'vweb.assets: unknown asset type'
|
||||
@@ -21,7 +19,7 @@ pub mut:
|
||||
// when true assets will be minified
|
||||
minify bool
|
||||
// the directory to store the cached/combined files
|
||||
cache_dir string
|
||||
cache_dir string
|
||||
}
|
||||
|
||||
struct Asset {
|
||||
@@ -75,11 +73,11 @@ fn (am AssetManager) combine(asset_type string, to_file bool) string {
|
||||
cache_key := am.get_cache_key(asset_type)
|
||||
out_file := '$am.cache_dir/${cache_key}.$asset_type'
|
||||
mut out := ''
|
||||
// use cache
|
||||
// use cache
|
||||
if os.exists(out_file) {
|
||||
if to_file {
|
||||
return out_file
|
||||
}
|
||||
}
|
||||
cached := os.read_file(out_file) or {
|
||||
return ''
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user