瀏覽代碼

grafana/toolkit: support windows paths (#18306)

Ryan McKinley 6 年之前
父節點
當前提交
294eabda5b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/grafana-toolkit/src/config/webpack.plugin.config.ts

+ 1 - 1
packages/grafana-toolkit/src/config/webpack.plugin.config.ts

@@ -42,7 +42,7 @@ const getModuleFiles = () => {
 
 
 const getManualChunk = (id: string) => {
 const getManualChunk = (id: string) => {
   if (id.endsWith('module.ts') || id.endsWith('module.tsx')) {
   if (id.endsWith('module.ts') || id.endsWith('module.tsx')) {
-    const idx = id.indexOf('/src/');
+    const idx = id.indexOf(path.sep + 'src' + path.sep);
     if (idx > 0) {
     if (idx > 0) {
       const name = id.substring(idx + 5, id.lastIndexOf('.'));
       const name = id.substring(idx + 5, id.lastIndexOf('.'));