webpack: scss, vue (#189)

WebPack에 scss와 vue를 사용할 수 있도록 세팅.

현재는 php서버와 코드가 강하게 엮여있기 때문에 vue-cli 대신 수동으로 webpack에 등록.

파일 번들링 경로는 다음과 같음

- scss + style -> css
- ts -> js

Reviewed-on: https://storage.hided.net/gitea/devsam/core/pulls/189
Co-authored-by: hide_d <hided62@gmail.com>
Co-committed-by: hide_d <hided62@gmail.com>
This commit is contained in:
2021-08-14 05:47:16 +09:00
parent 96faa924d8
commit 56daf15c8e
12 changed files with 153 additions and 34 deletions
+36
View File
@@ -103,6 +103,42 @@ class WebUtil
return $decoded;
}
public static function preloadCSS(string $path){
$upath = \phpUri::parse($path);
$path = $upath->join('');
if(!$upath->scheme && file_exists($upath->path)){
$mtime = filemtime($upath->path);
if($upath->query){
$tail = '&'.$mtime;
}
else{
$tail = '?'.$mtime;
}
}
else{
$tail = '';
}
return "<link href='{$path}{$tail}' rel='preload' as='style'>\n";
}
public static function preloadJS(string $path){
$upath = \phpUri::parse($path);
$path = $upath->join('');
if(!$upath->scheme && file_exists($upath->path)){
$mtime = filemtime($upath->path);
if($upath->query){
$tail = '&'.$mtime;
}
else{
$tail = '?'.$mtime;
}
}
else{
$tail = '';
}
return "<link href='{$path}{$tail}' rel='preload' as='script'>\n";
}
public static function printJS(string $path){
//async, defer 옵션 고려
$upath = \phpUri::parse($path);