Skip to content

Commit

Permalink
support scoped modules containing hyphens
Browse files Browse the repository at this point in the history
  • Loading branch information
rosswarren committed Feb 14, 2017
1 parent 0800951 commit 2fb246d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel

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


## [2.2.0] - 2016-11-07
Expand Down
2 changes: 1 addition & 1 deletion src/core/importType.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function isExternalModule(name, settings, path) {
return externalModuleRegExp.test(name) && isExternalPath(path, name, settings)
}

const scopedRegExp = /^@\w+\/\w+/
const scopedRegExp = /^@[^\/]+\/[^\/]+/
function isScoped(name) {
return scopedRegExp.test(name)
}
Expand Down
1 change: 1 addition & 0 deletions tests/src/core/importType.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe('importType(name)', function () {
it("should return 'external' for scopes packages", function() {
expect(importType('@cycle/core', context)).to.equal('external')
expect(importType('@cycle/dom', context)).to.equal('external')
expect(importType('@some-thing/something', context)).to.equal('external')
})

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

0 comments on commit 2fb246d

Please sign in to comment.