1
0
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:
yuyi
2020-04-26 19:49:31 +08:00
committed by GitHub
parent 7b39ab6d06
commit 9f4d498ff1
59 changed files with 181 additions and 254 deletions

View File

@@ -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 ''
}