Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

mpa打包后node服务器端运行会出现样式丢失 #4

Copy link
Copy link
Open
@qq282126990

Description

@qq282126990
Issue body actions

qq 20180224145948

此处是的node端运行的代码
https://github.com/qq282126990/musicApp/blob/mpa/prod.server.js

可能是由于打包后的路径不正确导致的

下面是官网处理history 的方法

// 处理HTML5 history API,映射例如/home路由到/home/index.html
let rewrites = Object.keys(utils.getEntries('./src/pages', 'entry.js'))
.map(function (entry) {
return {
from: new RegExp('/' + entry),
to: '/' + entry + '/index.html'
};
});
app.use(require('connect-history-api-fallback')({
htmlAcceptHeaders: ['text/html'],
rewrites: rewrites
}));

但是mpa实际打包后的路径是这样的
qq 20180224155235

这样会导致正则抓取不到打包后的html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.