Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not import module which locates at includePaths directories #113

Merged
merged 4 commits into from
Jul 22, 2015

Conversation

oopschen
Copy link
Contributor

bug or feature:

can not import modules locates at **includePaths" option.

solution

when webpack resolver fails to resolve modules, pass import as-is to node-sass instead of import as-is prefixed with underscore.

Thus the loader can resolve modules using webpack resolver and from libsass includePaths.

see issue #110 #98 for more details.

@jhnns
Copy link
Member

jhnns commented Jun 30, 2015

Thx for the pull-request. Please add tests that demonstrate what kind of bug you were trying to fix, so that future code changes won't regress this feature.

I'll review the PR as soon as I found some time.

@oopschen
Copy link
Contributor Author

sorry for no tests.
Please tell me the way to run the tests.
when i run npm test with no modification, i get error:

sass-loader@1.0.2 pretest /home/work/workspace/sass-loader/sass-loader
node test/prepare.js

/home/work/workspace/sass-loader/sass-loader/node_modules/node-sass/lib/index.js:409
throw util._extend(new Error(), JSON.parse(result.error));
^
Error: file to import not found or unreadable: ../node_modules/some-module
Current dir: /home/work/workspace/sass-loader/sass-loader/test/scss/
at Object.module.exports.renderSync (/home/work/workspace/sass-loader/sass-loader/node_modules/node-sass/lib/index.js:409:22)
at /home/work/workspace/sass-loader/sass-loader/test/prepare.js:36:24
at Array.map (native)
at /home/work/workspace/sass-loader/sass-loader/test/prepare.js:20:10
at Array.forEach (native)
at Object. (/home/work/workspace/sass-loader/sass-loader/test/prepare.js:12:18)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
npm ERR! Test failed. See above for more details.

Does it mean it has bugs in the master or i ran he wrong way

@oopschen oopschen changed the title pass the import as-is to libsass to utilize the libsass includePaths feature can not import module which locates at includePaths directories Jul 1, 2015
@oopschen
Copy link
Contributor Author

oopschen commented Jul 1, 2015

Update tests and feature demenstration.
Add contribution section to readme, thus newbies can run the tests correctly.

@jhnns
Copy link
Member

jhnns commented Jul 22, 2015

That looks good! 👍 I'll merge (and refactor) and publish it in a few days.

Sorry, I was not aware that the tests were not running for people cloning a fresh copy of the repository. It should work for everyone without extra work just by running npm test.

jhnns added a commit that referenced this pull request Jul 22, 2015
can not import module which locates at includePaths directories
@jhnns jhnns merged commit 49380eb into webpack-contrib:master Jul 22, 2015
@jhnns
Copy link
Member

jhnns commented Jul 22, 2015

Shipped with 1.0.3

This was referenced Jul 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants