From d9ae08dc8f6a4d570639ea9cc7f3d12ac8d6204c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B0=8F=E8=81=AA?= Date: Fri, 21 Dec 2018 14:26:05 +0800 Subject: [PATCH] :bug: fix windos class name (#3183) --- config/config.js | 5 +++-- package.json | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config/config.js b/config/config.js index c7910ea6..8b56d031 100644 --- a/config/config.js +++ b/config/config.js @@ -3,6 +3,7 @@ import os from 'os'; import pageRoutes from './router.config'; import webpackPlugin from './plugin.config'; import defaultSettings from '../src/defaultSettings'; +import slash from 'slash2'; const plugins = [ [ @@ -96,8 +97,8 @@ export default { } const match = context.resourcePath.match(/src(.*)/); if (match && match[1]) { - const antdProPath = match[1].replace('.less', ''); - const arr = antdProPath + const antdProPath = match[1].replace('.less', ''); + const arr = slash(antdProPath) .split('/') .map(a => a.replace(/([A-Z])/g, '-$1')) .map(a => a.toLowerCase()); diff --git a/package.json b/package.json index 0f5c296e..69b1a43f 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,8 @@ "tslint-react": "^3.6.0", "umi": "^2.2.7", "umi-plugin-ga": "^1.1.3", - "umi-plugin-react": "^1.2.0" + "umi-plugin-react": "^1.2.0", + "slash2": "^2.0.0" }, "optionalDependencies": { "puppeteer": "^1.10.0" -- GitLab