From 687fab427ecbd1a44e7b890bbd765c595a6f1beb Mon Sep 17 00:00:00 2001 From: Zhang Jun Yi <442665319@qq.com> Date: Sat, 2 Mar 2019 10:26:53 +0800 Subject: [PATCH] =?UTF-8?q?node=20path=20=E5=85=BC=E5=AE=B9windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows系统node路径和OSX或者Linux不相同 var filePath = path.join(foo, bar); // 'foo/bar' on OSX and Linux // 'foo\\bar' on Windows --- ykit.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ykit.config.js b/ykit.config.js index 9cd0d82c..77822a75 100755 --- a/ykit.config.js +++ b/ykit.config.js @@ -11,6 +11,7 @@ var assetsPluginInstance = new AssetsPlugin({ var fs = require('fs'); var package = require('./package.json'); var yapi = require('./server/yapi'); +var isWin = require('os').platform() === 'win32' var compressPlugin = new CompressionPlugin({ asset: '[path].gz[query]', @@ -78,7 +79,7 @@ module.exports = { defaultQuery.plugins.push(['import', { libraryName: 'antd' }]); return defaultQuery; }, - exclude: /(tui-editor|node_modules\/(?!_?(yapi-plugin|json-schema-editor-visual)))/ + exclude: isWin ? /(tui-editor|node_modules\\(?!_?(yapi-plugin|json-schema-editor-visual)))/ : /(tui-editor|node_modules\/(?!_?(yapi-plugin|json-schema-editor-visual)))/ } } ],