-
Notifications
You must be signed in to change notification settings - Fork 70
Feat update MPA build url path #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
看到 npm run build 的结果是 web/pages_Home_index.html,并不是 path |
情况是 start 变成 path 了,build 没有吗? |
|
这个 PR 先别合,SSR 的 plugin 里,对 MPA 页面有写死 assets 加载路径,https://github.com/raxjs/rax-scripts/blob/master/packages/build-plugin-rax-ssr/src/ssr/getEntries.js#L38,升级后会不兼容,我看看怎么解 另外 def 的链路验证 OK 不? |
好的 另外 @yacheng |
6481dab
|
本地测试验证通过 |
Update build directory rule as
{web|weex}/{route.path}/index.{html|js}Example:
app.json
{ "routes": [ { "path": "/", "source": "pages/Home/index" }, { "path": "/page1", "source": "pages/Page1/index" } ] }SPA
Result:
*.chunk.js is webpack code splitting file,
rule: {route.source.replace('/', '').toLocaleLowerCase()}. chunk.js
build/ web/ index.html index.js pages_home_index.chunk.js pages_page1_index.chunk.js weex/ index.jsIf your app use the
builddirectory as url, the url will be like:MPA
Result
build/ web/ index.html index.js path1/ index.html index.js weex/ index.js path1/ index.jsIf your app use the
builddirectory as url, the url will be like:Preview
