Skip to content

Commit

Permalink
fix: store-error-in-vite-mode (#6816)
Browse files Browse the repository at this point in the history
* fix: store error in vite mode

* chore: version and changelog
  • Loading branch information
luhc228 authored Mar 4, 2024
1 parent 2fa1363 commit 825afd2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/icejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ice.js",
"version": "2.6.8",
"version": "2.6.9",
"description": "command line interface and builtin plugin for icejs",
"author": "[email protected]",
"homepage": "",
Expand Down Expand Up @@ -33,7 +33,7 @@
"build-plugin-ice-request": "2.0.1",
"build-plugin-ice-router": "2.1.3",
"build-plugin-ice-ssr": "3.1.4",
"build-plugin-ice-store": "2.0.10",
"build-plugin-ice-store": "2.0.11",
"build-plugin-react-app": "2.2.4",
"build-plugin-pwa": "1.1.1",
"build-plugin-speed": "1.0.1",
Expand Down
4 changes: 4 additions & 0 deletions packages/plugin-store/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.0.11

- [fix] store error when the page name has `-` char in vite mode

## 2.0.10

- [feat] match page names with `-`
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-store/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "build-plugin-ice-store",
"version": "2.0.10",
"version": "2.0.11",
"description": "builtin `@ice/store` in icejs",
"author": "[email protected]",
"homepage": "https://github.com/alibaba/ice#readme",
Expand Down
5 changes: 3 additions & 2 deletions packages/plugin-store/src/vitePluginPageRedirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { Plugin } from 'vite';
import { formatPath } from '@builder/app-helpers';

const getPageName = (resolveId: string): { type: string; pageName: string; } => {
const layoutRegExp = /src\/pages\/(\w+)\/Layout/;
const pageRegExp = /src\/pages\/(\w+)(\/index)?(.(j|t)s(x)?)?$/;
const layoutRegExp = /src\/pages\/([^/*"]+)*\/Layout/;
const pageRegExp = /src\/pages\/([^/*"]+)*((.tsx|.jsx?)$|(\/index(.tsx|.jsx?)?)?$)/;

let type = '';
if (resolveId.match(pageRegExp)) {
type = 'page';
Expand Down

0 comments on commit 825afd2

Please sign in to comment.