diff --git a/.gitignore b/.gitignore index 7b695bdd..d6a328a1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ /coverage /lib /node_modules +/.idea npm-debug.log* package-lock.json diff --git a/src/config/plugin.js b/src/config/plugin.js index a40f21c0..ca530dc5 100644 --- a/src/config/plugin.js +++ b/src/config/plugin.js @@ -11,7 +11,7 @@ function getPackagePlugins(cwd) { return [ ...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.devDependencies || {}), - ].filter(dep => /^nwb-/.test(dep)) + ].filter(dep => /^(@[^/]+\/)?nwb-/.test(dep)) } /** diff --git a/tests/config-test.js b/tests/config-test.js index 9bd37f08..169c161c 100644 --- a/tests/config-test.js +++ b/tests/config-test.js @@ -317,6 +317,10 @@ describe('getPluginConfig()', () => { fake: { loader: 'path/to/fake.js', test: /\.fake$/, + }, + fakeVendor: { + loader: 'path/to/fake.js', + test: /\.fake$/, } } }) diff --git a/tests/fixtures/plugins/node_modules/@vendor/nwb-testplugin/index.js b/tests/fixtures/plugins/node_modules/@vendor/nwb-testplugin/index.js new file mode 100644 index 00000000..9cbdf741 --- /dev/null +++ b/tests/fixtures/plugins/node_modules/@vendor/nwb-testplugin/index.js @@ -0,0 +1,8 @@ +module.exports = { + cssPreprocessors: { + fakeVendor: { + test: /\.fake$/, + loader: 'path/to/fake.js' + } + } +} diff --git a/tests/fixtures/plugins/node_modules/@vendor/nwb-testplugin/package.json b/tests/fixtures/plugins/node_modules/@vendor/nwb-testplugin/package.json new file mode 100644 index 00000000..14ab704d --- /dev/null +++ b/tests/fixtures/plugins/node_modules/@vendor/nwb-testplugin/package.json @@ -0,0 +1,3 @@ +{ + "main": "index.js" +} diff --git a/tests/fixtures/plugins/package.json b/tests/fixtures/plugins/package.json index 59395f95..b6fd3814 100644 --- a/tests/fixtures/plugins/package.json +++ b/tests/fixtures/plugins/package.json @@ -1,5 +1,6 @@ { "devDependencies": { - "nwb-testplugin": "*" + "nwb-testplugin": "*", + "@vendor/nwb-testplugin": "*" } }