Skip to content

Fix non-relative pathname detection #74

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

Merged
merged 2 commits into from
Aug 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ module.exports = function setupHook({
*/
function fetch(_to, from) {
// getting absolute path to the processing file
const filename = /\w/i.test(_to[0])
const filename = /[^\\/?%*:|"<>\.]/i.test(_to[0])
? require.resolve(_to)
: resolve(dirname(from), _to);

Expand Down
3 changes: 2 additions & 1 deletion test/tokens/cases/compose-node-module/expected.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"foo": "_test_tokens_cases_compose_node_module_source__foo _test_tokens_node_modules_awesome_theme_common__paragraph _test_tokens_node_modules_awesome_theme_oceanic__color"
"foo": "_test_tokens_cases_compose_node_module_source__foo _test_tokens_node_modules_awesome_theme_common__paragraph _test_tokens_node_modules_awesome_theme_oceanic__color",
"bar": "_test_tokens_cases_compose_node_module_source__bar _test_tokens_node_modules_privateorg_theme_common__button"
}
5 changes: 5 additions & 0 deletions test/tokens/cases/compose-node-module/source.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
{
composes: paragraph from 'awesome-theme/common.css';
}

.bar
{
composes: button from '@privateorg/theme/common.css';
}
4 changes: 4 additions & 0 deletions test/tokens/node_modules/@privateorg/theme/common.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.