From 3252f681a3cbb025fc6d5d2273c3b55c8356230b Mon Sep 17 00:00:00 2001 From: cha0s Date: Mon, 7 Dec 2020 06:20:30 -0600 Subject: [PATCH] fix: prefer source mod --- packages/core/src/start.js | 7 ++++--- template/webpack.config.js | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/core/src/start.js b/packages/core/src/start.js index b6ade8b..bcf9168 100644 --- a/packages/core/src/start.js +++ b/packages/core/src/start.js @@ -12,11 +12,12 @@ const r = eval('require'); const config = readConfig(); const paths = Object.entries(config).map(([plugin]) => { try { - r.resolve(plugin); - return plugin; + const local = join(process.cwd(), 'src', plugin); + r.resolve(local); + return local; } catch (error) { - return join(process.cwd(), plugin); + return plugin; } }); const latus = new Latus({ diff --git a/template/webpack.config.js b/template/webpack.config.js index 990d4f3..6f8e231 100644 --- a/template/webpack.config.js +++ b/template/webpack.config.js @@ -11,11 +11,12 @@ module.exports = new Promise(async (resolve, reject) => { const config = readConfig(); const paths = Object.entries(config).map(([plugin]) => { try { - require.resolve(plugin); - return plugin; + const local = join(process.cwd(), 'src', plugin); + require.resolve(local); + return local; } catch (error) { - return join(process.cwd(), plugin); + return plugin; } }); const latus = new Latus({