|
1 | 1 | /* eslint-disable consistent-return */
|
2 | 2 | /* eslint-disable no-useless-escape */
|
3 |
| -const path = require('path'); |
4 |
| - |
5 |
| -const { createFsFromVolume, Volume } = require('memfs'); |
6 |
| -const webpack = require('webpack'); |
7 | 3 |
|
8 | 4 | const installer = require('./installer');
|
9 | 5 | const utils = require('./utils');
|
@@ -48,9 +44,6 @@ class NpmInstallPlugin {
|
48 | 44 | apply(compiler) {
|
49 | 45 | this.compiler = compiler;
|
50 | 46 |
|
51 |
| - // Recursively install missing dependencies so primary build doesn't fail |
52 |
| - compiler.hooks.watchRun.tapAsync(PLUGIN_NAME, this.preCompile.bind(this)); |
53 |
| - |
54 | 47 | // Install externals that wouldn't normally be resolved
|
55 | 48 | if (Array.isArray(compiler.options.externals)) {
|
56 | 49 | compiler.options.externals.unshift(this.resolveExternal.bind(this));
|
@@ -97,28 +90,6 @@ class NpmInstallPlugin {
|
97 | 90 | }
|
98 | 91 | }
|
99 | 92 |
|
100 |
| - preCompile(compilation, next) { |
101 |
| - if (!this.preCompiler) { |
102 |
| - const { options } = this.compiler; |
103 |
| - const config = Object.assign( |
104 |
| - // Start with new config object |
105 |
| - {}, |
106 |
| - // Inherit the current config |
107 |
| - options, |
108 |
| - { |
109 |
| - // Register plugin to install missing deps |
110 |
| - plugins: [new NpmInstallPlugin(this.options)], |
111 |
| - } |
112 |
| - ); |
113 |
| - |
114 |
| - this.preCompiler = webpack(config); |
115 |
| - this.preCompiler.outputFileSystem = createFsFromVolume(new Volume()); |
116 |
| - this.preCompiler.outputFileSystem.join = path.join.bind(path); |
117 |
| - } |
118 |
| - |
119 |
| - this.preCompiler.run(next); |
120 |
| - } |
121 |
| - |
122 | 93 | resolveExternal(context, request, callback) {
|
123 | 94 | // Only install direct dependencies, not sub-dependencies
|
124 | 95 | if (context.match('node_modules')) {
|
|
0 commit comments