diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..57301a8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,25 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +.DS_Store +coverage +*.local + +dist +node_modules +.vscode/* +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? +docs +node \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a996849..07583d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,17 @@ # syntax = docker/dockerfile:experimental -FROM --platform=${BUILDPLATFORM:-linux/amd64,linux/arm64} node:18-buster AS builder +FROM --platform=${BUILDPLATFORM:-linux/amd64,linux/arm64} node:20-buster AS builder ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" RUN corepack enable -WORKDIR /app -COPY . . +WORKDIR /src +COPY ./ ./ # RUN两次方便观察install和build, 也可以用pnpm cache and locked -RUN pnpm install && pnpm run build +RUN pnpm install +RUN npm run build FROM --platform=${BUILDPLATFORM:-linux/amd64,linux/arm64} ghcr.io/rookie-luochao/nginx-runner:latest -COPY --from=builder /app/dist . \ No newline at end of file +COPY --from=builder /src/dist /app \ No newline at end of file diff --git a/src/App2.vue b/src/App2.vue deleted file mode 100644 index 99e0e98..0000000 --- a/src/App2.vue +++ /dev/null @@ -1,183 +0,0 @@ - - - - diff --git a/src/main2.ts b/src/main2.ts deleted file mode 100644 index 30fba91..0000000 --- a/src/main2.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { createApp } from 'vue' -import App from './App.vue' -import './assets/less/index.less' -import { startMock } from '@/mock' -import router from './router' -import mixin from './utils/mixin' -import VueLazyload from '@jambonn/vue-lazyload' -import { createPinia } from 'pinia' -import { useClick } from '@/utils/hooks/useClick' -import bus, { EVENT_KEY } from '@/utils/bus' - -window.isMoved = false -window.isMuted = true -window.showMutedNotice = true -HTMLElement.prototype.addEventListener = new Proxy(HTMLElement.prototype.addEventListener, { - apply(target, ctx, args) { - const eventName = args[0] - const listener = args[1] - if (listener instanceof Function && eventName === 'click') { - args[1] = new Proxy(listener, { - apply(target1, ctx1, args1) { - // console.log('e', args1) - // console.log('click点击', window.isMoved) - if (window.isMoved) return - try { - return target1.apply(ctx1, args1) - } catch (e) { - console.error(`[proxyPlayerEvent][${eventName}]`, listener, e) - } - } - }) - } - return target.apply(ctx, args) - } -}) - -const vClick = useClick() -const pinia = createPinia() -const app = createApp(App) -app.mixin(mixin) -const loadImage = new URL('./assets/img/icon/img-loading.png', import.meta.url).href -app.use(VueLazyload, { - preLoad: 1.3, - loading: loadImage, - attempt: 1 -}) -app.use(pinia) -app.use(router) -app.mount('#app') -app.directive('click', vClick) - -//放到最后才可以使用pinia -startMock() -setTimeout(() => { - bus.emit(EVENT_KEY.HIDE_MUTED_NOTICE) - window.showMutedNotice = false -}, 2000) -bus.on(EVENT_KEY.REMOVE_MUTED, () => { - window.isMuted = false -})