From b1f3e5f4ea4583352fbd33db1e1a5d54c3855b40 Mon Sep 17 00:00:00 2001 From: jheyming Date: Mon, 4 Sep 2017 22:05:17 -0700 Subject: [PATCH] Ensure webpack.js resolves before modules.js I had a webpack configuration where modules.js was resolving node_modules/foo when I wanted my webpack.config.js to be resolved instead. In order to enforce the correct order, I changed the resolve addition to unshift instead of push to the array. This ensures webpack resolves before modules. --- plugin/webpack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/webpack.js b/plugin/webpack.js index 7192563d..658ad574 100644 --- a/plugin/webpack.js +++ b/plugin/webpack.js @@ -76,7 +76,7 @@ tern.registerPlugin("webpack", function(server, options) { var resolver = getResolver(modules, configPath) server.loadPlugin("commonjs") server.loadPlugin("es_modules") - server.mod.modules.resolvers.push(function (name, parentFile) { + server.mod.modules.resolvers.unshift(function (name, parentFile) { var resolved = resolveToFile(resolver, name, parentFile) return resolved && infer.cx().parent.normalizeFilename(resolved) })