Skip to content

Commit 2fb246d

Browse files
committed
support scoped modules containing hyphens
1 parent 0800951 commit 2fb246d

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
1313

1414
### Fixed
1515
- attempt to fix crash in [`no-mutable-exports`]. ([#660])
16+
- support scoped modules containing non word characters
1617

1718

1819
## [2.2.0] - 2016-11-07

src/core/importType.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function isExternalModule(name, settings, path) {
2727
return externalModuleRegExp.test(name) && isExternalPath(path, name, settings)
2828
}
2929

30-
const scopedRegExp = /^@\w+\/\w+/
30+
const scopedRegExp = /^@[^\/]+\/[^\/]+/
3131
function isScoped(name) {
3232
return scopedRegExp.test(name)
3333
}

tests/src/core/importType.js

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ describe('importType(name)', function () {
3131
it("should return 'external' for scopes packages", function() {
3232
expect(importType('@cycle/core', context)).to.equal('external')
3333
expect(importType('@cycle/dom', context)).to.equal('external')
34+
expect(importType('@some-thing/something', context)).to.equal('external')
3435
})
3536

3637
it("should return 'internal' for non-builtins resolved outside of node_modules", function () {

0 commit comments

Comments
 (0)