Skip to content

Commit

Permalink
chore: move all images to assets
Browse files Browse the repository at this point in the history
  • Loading branch information
Joabesv committed Feb 11, 2024
1 parent aa26817 commit bd52abf
Show file tree
Hide file tree
Showing 19 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.13.2
v20.10.0
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion src/manifest.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export async function getManifest() {
{
resources: [
"components/*",
"images/*",
"assets/*",
"lib/*",
"pages/*",
"scripts/*",
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/contentScriptPortal.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { NextAPI } from "../services/NextAPI";
import Axios from "axios";
import Toastify from "toastify-js";
import "toastify-js/src/toastify.css";
const loading = require("../images/loading.svg");
const errorSVG = require("../images/error.svg");
const logoWhite = require("../images/logo-white.svg");
const loading = require("../assets/loading.svg");
const errorSVG = require("../assets/error.svg");
const logoWhite = require("../assets/logo-white.svg");

const nextApi = NextAPI();

Expand Down
2 changes: 1 addition & 1 deletion src/views/Matricula.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="ufabc-row filters">
<div class="mr-3 ufabc-row ufabc-align-center">
<img
:src="getUrl('/images/icon-128.png')"
:src="getUrl('/assets/icon-128.png')"
style="width: 32px; height: 32px"
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/views/Popup/Popup.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="ufabc-next-popup">
<img src="../../images/logo.svg" width="150" height="33" />
<img src="/assets/logo.svg" width="150" height="33" />

<div class="intro">
<div class="loading" v-if="loading">
Expand Down
2 changes: 1 addition & 1 deletion tasks/mvsw.dev.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { logger } from "./utils.mjs";

(async () => {
try {
await cp(resolve("src/images"), resolve("extension/dev/assets"), {
await cp(resolve("src/assets"), resolve("extension/dev/assets"), {
recursive: true,
});
await rename(
Expand Down
3 changes: 1 addition & 2 deletions tasks/mvsw.prod.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { cp, rename, rm } from "node:fs/promises";

(async () => {
try {
console.log(resolve("src/images"));
await cp(resolve("src/images"), resolve("extension/prod/assets"), {
await cp(resolve("src/assets"), resolve("extension/prod/assets"), {
recursive: true,
});
await rename(
Expand Down
9 changes: 6 additions & 3 deletions vite.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolve, dirname } from "node:path";
import { resolve, dirname, relative } from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "vite";
import Vue2 from "@vitejs/plugin-vue2";
Expand Down Expand Up @@ -41,8 +41,11 @@ export default defineConfig(({ command }) => {
name: "assets-rewrite",
enforce: "post",
apply: "build",
transformIndexHtml(html) {
return html.replace(/"\/assets\//g, '"../images/');
transformIndexHtml(html, { path }) {
return html.replace(
/"\/assets\//g,
`"${relative(dirname(path), "/assets")}/`
);
},
},
],
Expand Down

0 comments on commit bd52abf

Please sign in to comment.