11import path from 'path' ;
2-
32const pkg = require ( "../package.json" ) ;
3+
44const APP_NAME = pkg . name ;
5- const CUR_DIR = path . normalize ( __dirname + "/ ..") ;
5+ const CUR_DIR = path . resolve ( __dirname , " ..") ;
66
7- const SRC_BASE = "/ src" ;
8- const TAR_BASE = "/ target" ;
9- const VENDOR_BASE = "/ vendor" ;
7+ const SRC_BASE = "src" ;
8+ const TAR_BASE = "target" ;
9+ const VEN_BASE = "vendor" ;
1010
1111const CSS_BUNDLE_NAME = APP_NAME + "-bundle.min.css" ;
1212const JS_BUNDLE_NAME = APP_NAME + "-bundle.min.js" ;
@@ -16,24 +16,22 @@ const Config = {
1616 CUR_DIR ,
1717 TRACK_ID : "UA-xxx-1111" ,
1818 APP_NAME ,
19- SRC_BASE ,
20- TAR_BASE ,
2119 src : {
22- path : CUR_DIR + SRC_BASE ,
23- js_path : CUR_DIR + SRC_BASE + "/ scripts",
24- js_entry : CUR_DIR + SRC_BASE + "/ scripts/ client/ main.js",
25- sass_path : CUR_DIR + SRC_BASE + "/ styles",
26- img_path : CUR_DIR + SRC_BASE + "/ images",
27- vendor_css : CUR_DIR + VENDOR_BASE + "/ css",
28- vendor_js : CUR_DIR + VENDOR_BASE + "/ js"
20+ path : path . join ( CUR_DIR , SRC_BASE ) ,
21+ js_path : path . join ( CUR_DIR , SRC_BASE , " scripts") ,
22+ js_entry : path . join ( CUR_DIR , SRC_BASE , " scripts" , " client" , " main.js") ,
23+ sass_path : path . join ( CUR_DIR , SRC_BASE , " styles") ,
24+ img_path : path . join ( CUR_DIR , SRC_BASE , " images") ,
25+ vendor_css : path . join ( CUR_DIR , VEN_BASE , " css") ,
26+ vendor_js : path . join ( CUR_DIR , VEN_BASE , " js")
2927 } ,
3028 target : {
31- path : CUR_DIR + TAR_BASE ,
29+ path : path . join ( CUR_DIR , TAR_BASE ) ,
30+ js_path : path . join ( CUR_DIR , TAR_BASE , "js" ) ,
31+ css_path : path . join ( CUR_DIR , TAR_BASE , "css" ) ,
32+ img_path : path . join ( CUR_DIR , TAR_BASE , "img" ) ,
3233 js_bundle : JS_BUNDLE_NAME ,
33- css_bundle : "../css/" + CSS_BUNDLE_NAME ,
34- js_path : CUR_DIR + TAR_BASE + "/js" ,
35- css_path : CUR_DIR + TAR_BASE + "/css" ,
36- img_path : CUR_DIR + TAR_BASE + "/img"
34+ css_bundle : `..${ path . sep } css${ path . sep } ${ CSS_BUNDLE_NAME } `
3735 } ,
3836 root_files : "*(*.png|*.xml|*.ico|*.txt|*.html|.htaccess|site.webmanifest)" ,
3937 image_files : [ '**/*.jp*g' , '**/*.png' , '**/*.gif' , '**/*.svg' ]
0 commit comments