diff --git a/package.json b/package.json index 7858101..34242a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "scripts": { - "dev": "snowpack dev", + "dev": "SNOWPACK_PUBLIC_API_URL=https://publitebackend.dmitriy.icu snowpack dev", "build": "snowpack build", "test": "echo \"Error: no test specified\" && exit 1" }, diff --git a/snowpack.config.js b/snowpack.config.js index 2cba93b..e61b9af 100644 --- a/snowpack.config.js +++ b/snowpack.config.js @@ -21,5 +21,9 @@ module.exports = { devOptions: { open: "none", }, + alias: { "@assets": "./src/assets" }, exclude: ["**/node_modules/**/*", "**/*.test.*"], + env: { + // API_URL: "https://publitebackend.dmitriy.icu", + }, }; diff --git a/src/Bookshelf/AddBook/index.tsx b/src/Bookshelf/AddBook/index.tsx index 11fca23..3984d97 100644 --- a/src/Bookshelf/AddBook/index.tsx +++ b/src/Bookshelf/AddBook/index.tsx @@ -1,6 +1,6 @@ import React from "react"; -import plusIcon from "./plus.svg"; +import plusIcon from "@assets/plus.svg"; import styles from "./AddBook.module.css"; export const AddBook = () => { diff --git a/src/Bookshelf/AddBook/plus.svg b/src/assets/plus.svg similarity index 100% rename from src/Bookshelf/AddBook/plus.svg rename to src/assets/plus.svg diff --git a/tsconfig.json b/tsconfig.json index 9817e1d..99b7415 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,6 +9,7 @@ "lib": ["DOM"], "module": "ES2020", "moduleResolution": "node", - "resolveJsonModule": true + "resolveJsonModule": true, + "paths": { "@assets/*": ["src/assets/*"] } } }