Skip to content

Commit ebf70b0

Browse files
committed
Remove hook that filters out Drupal dependencies, breaks externals
1 parent 96f641b commit ebf70b0

2 files changed

Lines changed: 3 additions & 13 deletions

File tree

lib/DrupalLibrariesPlugin.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,6 @@ class DrupalLibrariesPlugin {
4949
* The webpack compiler.
5050
*/
5151
apply(compiler) {
52-
// Prevents drupal library dependencies from being included.
53-
compiler.hooks.normalModuleFactory.tap('DrupalLibrariesPlugin', cmf => {
54-
cmf.hooks.factorize.tapAsync("DrupalLibrariesPlugin", (data, callback) => {
55-
const result = this.opts.requirePattern.exec(data.request)
56-
if (result) {
57-
callback(null, new DrupalLibraryModule(result[1]))
58-
}
59-
else {
60-
return callback()
61-
}
62-
})
63-
})
64-
6552
// Analyzes the final chunks to determine library dependencies.
6653
compiler.hooks.done.tapPromise('DrupalLibrariesPlugin', async stats => {
6754
this.metadata = await this._generateLibraryMetadata(stats.compilation)

test/library-dependency.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ test('Generates a library entry for @drupal(core/drupal)', async () => {
66
entry: {
77
'require-drupal': path.resolve(__dirname, './fixtures/require-drupal.es6.js'),
88
},
9+
externals: {
10+
'@drupal(drupal/core)': 'Drupal'
11+
}
912
})).result
1013

1114
expect(result).toEqual({

0 commit comments

Comments
 (0)