From ef834c1b437226625058663d6823dbfe7698a48f Mon Sep 17 00:00:00 2001 From: mashirozx Date: Wed, 15 Sep 2021 11:00:17 +0800 Subject: [PATCH] Add Windows build compatibility --- app/functions.php | 2 +- package.json | 8 +++++--- src/admin/Core.vue | 9 +++++---- yarn.lock | 9 ++++++++- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/app/functions.php b/app/functions.php index 6167c2f..8500532 100644 --- a/app/functions.php +++ b/app/functions.php @@ -5,7 +5,7 @@ define('SAKURA_VERSION', wp_get_theme()->get('Version')); define('SAKURA_TEXT_DOMAIN', wp_get_theme()->get('TextDomain')); -define('SAKURA_DEVEPLOMENT', true); +define('SAKURA_DEVEPLOMENT', false); define('SAKURA_DEVEPLOMENT_HOST', 'http://127.0.0.1:9000'); // PHP loaders diff --git a/package.json b/package.json index 3d13a3a..720bcd5 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "scripts": { "dev": "vite", "build": "yarn bulid:main && yarn build:admin", - "bulid:main": "APP_TARGET=main vite build", - "build:admin": "APP_TARGET=admin vite build", + "bulid:main": "cross-env APP_TARGET=main vite build", + "build:admin": "cross-env APP_TARGET=admin vite build", "build:strict": "vue-tsc --noEmit && vite build", "serve": "vite preview", "test": "jest --coverage", @@ -25,7 +25,8 @@ "rsync:composer": "nodemon --watch './composer.json' --watch './composer.lock' scripts/rsync.mjs --composer", "icon": "yarn svgo -f ./src/assets/icons/ui/ && node scripts/import-svg-icons.mjs && eslint \"src/components/icon/**/*.{ts,js,json,vue}\" --fix && prettier \"src/components/icon/**/*.{ts,js,json,vue}\" --write", "mdc": "node scripts/mdc-upgrade.mjs", - "options": "node scripts/options-export/copy-options.mjs && yarn tsc scripts/options-export/dump-options.ts && node scripts/options-export/dump-options.js && eslint \"src/admin/optionsType.ts\" --fix && prettier \"src/admin/optionsType.ts\" --write" + "options": "node scripts/options-export/copy-options.mjs && yarn tsc scripts/options-export/dump-options.ts && node scripts/options-export/dump-options.js && eslint \"src/admin/optionsType.ts\" --fix && prettier \"src/admin/optionsType.ts\" --write", + "win:esbuild": "node ./node_modules/esbuild/install.js" }, "dependencies": { "@formatjs/intl": "^1.13.4", @@ -88,6 +89,7 @@ "autoprefixer": "^10.3.1", "camelcase": "^6.2.0", "colors": "^1.4.0", + "cross-env": "^7.0.3", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-plugin-file-progress": "^1.1.0", diff --git a/src/admin/Core.vue b/src/admin/Core.vue index 4437ffb..56168af 100644 --- a/src/admin/Core.vue +++ b/src/admin/Core.vue @@ -49,7 +49,8 @@