From 909528ff0704317e6e80180c52f9271b6027e716 Mon Sep 17 00:00:00 2001 From: zhazhaxia <337262356@qq.com> Date: Mon, 24 Feb 2020 00:03:25 +0800 Subject: [PATCH 1/3] fix: apipath fix on windows platform --- lib/loaders/entry-loader.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/loaders/entry-loader.js b/lib/loaders/entry-loader.js index 49753ab..0c3313e 100644 --- a/lib/loaders/entry-loader.js +++ b/lib/loaders/entry-loader.js @@ -1,7 +1,9 @@ const path = require('path'); const loaderUtils = require('loader-utils'); -const apiPath = path.join(__dirname, 'api.js'); - +var apiPath = path.join(__dirname, 'api.js') +if(/win32/gi.test(process.platform)){ + apiPath = apiPath.replace(/\\/g,'\\\\') +} module.exports = function() { const { activationUrl, ips } = loaderUtils.getOptions(this) || {}; From 4f128fdcf5583e9ec71cb1c2c852f5b04f3e8ca4 Mon Sep 17 00:00:00 2001 From: zhazhaxia <337262356@qq.com> Date: Fri, 28 Feb 2020 11:45:03 +0800 Subject: [PATCH 2/3] fix: the split line compatible --- lib/loaders/entry-loader.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/loaders/entry-loader.js b/lib/loaders/entry-loader.js index 0c3313e..a77f5ae 100644 --- a/lib/loaders/entry-loader.js +++ b/lib/loaders/entry-loader.js @@ -1,9 +1,7 @@ const path = require('path'); const loaderUtils = require('loader-utils'); -var apiPath = path.join(__dirname, 'api.js') -if(/win32/gi.test(process.platform)){ - apiPath = apiPath.replace(/\\/g,'\\\\') -} +const apiPath = path.join(__dirname, 'api.js').split(path.sep).join('/'); + module.exports = function() { const { activationUrl, ips } = loaderUtils.getOptions(this) || {}; From fb7a4aa8a38856ab99796a2486d4c44d43af31b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A3=E6=B8=A3=E5=A4=8F=5F=E5=92=AA=E8=B7=AF?= <337262356@qq.com> Date: Fri, 28 Feb 2020 11:51:07 +0800 Subject: [PATCH 3/3] Update entry-loader.js fix the path on windows --- lib/loaders/entry-loader.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/loaders/entry-loader.js b/lib/loaders/entry-loader.js index 0c3313e..a77f5ae 100644 --- a/lib/loaders/entry-loader.js +++ b/lib/loaders/entry-loader.js @@ -1,9 +1,7 @@ const path = require('path'); const loaderUtils = require('loader-utils'); -var apiPath = path.join(__dirname, 'api.js') -if(/win32/gi.test(process.platform)){ - apiPath = apiPath.replace(/\\/g,'\\\\') -} +const apiPath = path.join(__dirname, 'api.js').split(path.sep).join('/'); + module.exports = function() { const { activationUrl, ips } = loaderUtils.getOptions(this) || {};