sleepy-zone / fabritor-web

👻 A creative editor based on fabricjs. 一款基于 fabricjs 的开源创意图片编辑器,旨在让开发者快速构建属于自己的图片编辑器。可应用于海报设计、小红书公众号封面设计、banner 设计等场景。
https://fabritor.surge.sh/
MIT License
922 stars 120 forks source link

请教:如何修改配置,npm run build打包后,可以放置在网站根目录里的二级目录(如:fabritor)里 #8

Closed WaterCountry closed 8 months ago

WaterCountry commented 8 months ago

framework.js:1 e {status: 404, statusText: 'Not Found', internal: true, data: 'Error: No route matches URL "/fabritor/index.html"', error: Error: No route matches URL "/fabritor/index.html" at ey (http://192.168.1.3/fabritor/js/framew…} data : "Error: No route matches URL \"/fabritor/index.html\"" error : Error: No route matches URL "/fabritor/index.html" at ey (http://192.168.1.3/fabritor/js/framework.js:1:47360) at http://192.168.1.3/fabritor/js/framework.js:1:23067 at http://192.168.1.3/fabritor/js/87.js:1:34657 at Object.next (http://192.168.1.3/fabritor/js/87.js:1:34762) at r (http://192.168.1.3/fabritor/js/87.js:1:27396) at a (http://192.168.1.3/fabritor/js/87.js:1:27593) at http://192.168.1.3/fabritor/js/87.js:1:27652 at new Promise (<anonymous>) at http://192.168.1.3/fabritor/js/87.js:1:27534 at eJ (http://192.168.1.3/fabritor/js/framework.js:1:24195) 网上搜索了一下,在package.json里添加homepage: './fabritor' 无效

WaterCountry commented 8 months ago

`import { defineConfig } from '@ice/app';

// The project config, see https://v3.ice.work/docs/guide/basic/config const minify = process.env.NODE_ENV === 'production' ? 'swc' : false; export default defineConfig(() => ({ // Set your configs here. outputDir:'poster', //hash: true, publicPath: '/poster/', minify, ssr: false, ssg: false, dataLoader: false, server: { onDemand: true, format: 'esm', },

}));` 配置资源路径后,还有一样问题,framework.js有route路由问题 { "status": 404, "statusText": "Not Found", "internal": true, "data": "Error: No route matches URL \"/poster/index.html\"", "error": {} }

WaterCountry commented 8 months ago

飞冰项目如何打包,部署到二级目录下,而不是默认根目录下? (使用iis静态页面index.html)

WaterCountry commented 8 months ago

vue cli3-cli4 打包后项目在二级路径的方法如下,但是飞冰不知道如何设置? 假设我们的二级目录是:/web const router = new VueRouter({ mode: 'history', base: process.env.NODE_ENV === "production" ? "/web" : process.env.BASE_URL, routes })

WaterCountry commented 8 months ago

vue cli3-cli4 打包后项目在二级路径的方法如下,但是飞冰不知道如何设置? 假设我们的二级目录是:/web const router = new VueRouter({ mode: 'history', base: process.env.NODE_ENV === "production" ? "/web" : process.env.BASE_URL, routes })

WaterCountry commented 8 months ago

vue cli3-cli4 打包后项目在二级路径的方法如下,但是飞冰不知道如何设置? 假设我们的二级目录是:/web const router = new VueRouter({ mode: 'history', base: process.env.NODE_ENV === "production" ? "/web" : process.env.BASE_URL, routes })

sleepy-zone commented 8 months ago

publicPath 配合 router baseName 试一下? https://v3.ice.work/docs/guide/basic/app#router