]> git.kaiwu.me - njs.git/commit
Change: imported modules are not resolved relative to current dir.
authorDmitry Volyntsev <xeioex@nginx.com>
Wed, 24 Jan 2024 00:33:52 +0000 (16:33 -0800)
committerDmitry Volyntsev <xeioex@nginx.com>
Wed, 24 Jan 2024 00:33:52 +0000 (16:33 -0800)
commit8fd9bd0930990eb2d4f6b5046328415b6cb715e5
treeaeee0f323a627c31abcce9ece781a276236a31c2
parent9edee0bcddad996068c7b1a7a63f35afb831ae64
Change: imported modules are not resolved relative to current dir.

Previously, when a module was imported with a relative path
it was looked for first in the directory of the importing context
(global, or a module).

For example when:
    main.js:
        import libs/lib1.js;

    libs/lib1.js:
        import lib2.js;

lib2.js was looked for first in libs/.

Now, it is only looked for in directories speficied with js_path
and a directory of nginx configuration file.
src/njs_module.c
test/js/import_chain.t.js
test/js/import_relative_path.t.js [deleted file]
test/shell_test.exp