Add Windows build compatibility

This commit is contained in:
mashirozx 2021-09-15 11:00:17 +08:00
parent f1dbe40d00
commit ef834c1b43
4 changed files with 19 additions and 9 deletions

View File

@ -5,7 +5,7 @@
define('SAKURA_VERSION', wp_get_theme()->get('Version')); define('SAKURA_VERSION', wp_get_theme()->get('Version'));
define('SAKURA_TEXT_DOMAIN', wp_get_theme()->get('TextDomain')); 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'); define('SAKURA_DEVEPLOMENT_HOST', 'http://127.0.0.1:9000');
// PHP loaders // PHP loaders

View File

@ -5,8 +5,8 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "yarn bulid:main && yarn build:admin", "build": "yarn bulid:main && yarn build:admin",
"bulid:main": "APP_TARGET=main vite build", "bulid:main": "cross-env APP_TARGET=main vite build",
"build:admin": "APP_TARGET=admin vite build", "build:admin": "cross-env APP_TARGET=admin vite build",
"build:strict": "vue-tsc --noEmit && vite build", "build:strict": "vue-tsc --noEmit && vite build",
"serve": "vite preview", "serve": "vite preview",
"test": "jest --coverage", "test": "jest --coverage",
@ -25,7 +25,8 @@
"rsync:composer": "nodemon --watch './composer.json' --watch './composer.lock' scripts/rsync.mjs --composer", "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", "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", "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": { "dependencies": {
"@formatjs/intl": "^1.13.4", "@formatjs/intl": "^1.13.4",
@ -88,6 +89,7 @@
"autoprefixer": "^10.3.1", "autoprefixer": "^10.3.1",
"camelcase": "^6.2.0", "camelcase": "^6.2.0",
"colors": "^1.4.0", "colors": "^1.4.0",
"cross-env": "^7.0.3",
"dotenv": "^10.0.0", "dotenv": "^10.0.0",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-plugin-file-progress": "^1.1.0", "eslint-plugin-file-progress": "^1.1.0",

View File

@ -49,7 +49,8 @@
<script lang="ts"> <script lang="ts">
import { defineComponent, ref, Ref, watch } from 'vue' import { defineComponent, ref, Ref, watch } from 'vue'
import { Swiper, SwiperSlide } from 'swiper/vue' import { Swiper, SwiperSlide } from 'swiper/vue'
import { Swiper as SwiperInterface } from 'swiper' import type { Swiper as SwiperInterface } from 'swiper'
import 'swiper/swiper.scss'
import { useInjector, useState, useMessage, useIntervalWatcher } from '@/hooks' import { useInjector, useState, useMessage, useIntervalWatcher } from '@/hooks'
import store from './store' import store from './store'
import options from './options' import options from './options'
@ -145,9 +146,9 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
@use '@/styles/mixins/polyfills'; @use '@/styles/mixins/polyfills';
::v-deep() { // ::v-deep() {
@import 'swiper/swiper'; // @import 'swiper/swiper';
} // }
.layout { .layout {
width: 100%; width: 100%;

View File

@ -2544,7 +2544,14 @@ cross-env@^6.0.3:
dependencies: dependencies:
cross-spawn "^7.0.0" cross-spawn "^7.0.0"
cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: cross-env@^7.0.3:
version "7.0.3"
resolved "https://registry.npm.taobao.org/cross-env/download/cross-env-7.0.3.tgz?cache=0&sync_timestamp=1606856336843&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcross-env%2Fdownload%2Fcross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
integrity sha1-hlJkspZ33AFbqEGJGJZd0jL8VM8=
dependencies:
cross-spawn "^7.0.1"
cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
version "7.0.3" version "7.0.3"
resolved "https://registry.nlark.com/cross-spawn/download/cross-spawn-7.0.3.tgz?cache=0&sync_timestamp=1624608055915&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcross-spawn%2Fdownload%2Fcross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" resolved "https://registry.nlark.com/cross-spawn/download/cross-spawn-7.0.3.tgz?cache=0&sync_timestamp=1624608055915&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcross-spawn%2Fdownload%2Fcross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha1-9zqFudXUHQRVUcF34ogtSshXKKY= integrity sha1-9zqFudXUHQRVUcF34ogtSshXKKY=