node path 兼容windows

Windows系统node路径和OSX或者Linux不相同
var filePath = path.join(foo, bar);
// 'foo/bar' on OSX and Linux
// 'foo\\bar' on Windows
This commit is contained in:
Zhang Jun Yi 2019-03-02 10:26:53 +08:00 committed by GitHub
parent b1aa7ce58c
commit 687fab427e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)))/
}
}
],