const globalCss = resolve(__dirname, 'global.css')
+/** @type {import('webpack').ConfigurationFactory} */
const config = (env = {}) => ({
// Expose __dirname to allow automatically setting basename.
context: __dirname,
},
plugins: [
new webpack.DefinePlugin({
- __DEV__: JSON.stringify(process.env.NODE_ENV !== 'production'),
+ __DEV__: JSON.stringify(!env.prod),
__CI__: JSON.stringify(process.env.CI || false),
__BROWSER__: 'true',
'process.env': {
{
- "include": ["./**/*.ts"],
+ "include": ["*.ts", "api", "../src/global.d.ts", "shim.d.ts"],
"compilerOptions": {
"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
TimelineEvent,
} from '@vue/devtools-api'
import { watch } from 'vue'
+import { decode } from './encoding'
import { RouterMatcher } from './matcher'
import { RouteRecordMatcher } from './matcher/pathMatcher'
import { PathParser } from './matcher/pathParserRanker'
router.beforeEach((to, from) => {
const data: TimelineEvent<any, any>['data'] = {
- guard: formatDisplay('beforEach'),
+ guard: formatDisplay('beforeEach'),
from: formatRouteLocation(
from,
'Current Location during this navigation'
api.on.getInspectorTree(payload => {
if (payload.app === app && payload.inspectorId === routerInspectorId) {
- const routes = matcher.getRoutes().filter(
- route =>
- !route.parent &&
- (!payload.filter ||
+ let routes = matcher.getRoutes()
+ if (payload.filter) {
+ routes = routes.filter(
+ route =>
+ !route.parent &&
// save isActive state
- isRouteMatching(route, payload.filter))
- )
+ isRouteMatching(route, payload.filter.toLowerCase())
+ )
+ }
// reset match state if no filter is provided
if (!payload.filter) {
routes.forEach(route => {
return false
}
+ const path = route.record.path.toLowerCase()
+ const decodedPath = decode(path)
+
// also allow partial matching on the path
- if (route.record.path.startsWith(filter)) return true
+ if (
+ !filter.startsWith('/') &&
+ (decodedPath.includes(filter) || path.includes(filter))
+ )
+ return true
+ if (decodedPath.startsWith(filter) || path.startsWith(filter)) return true
if (route.record.name && String(route.record.name).includes(filter))
return true