We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27f3534 commit 2573899Copy full SHA for 2573899
lib/config-generator.js
@@ -128,10 +128,11 @@ class ConfigGenerator {
128
* See shared-entry-concat-plugin.js for more details.
129
*/
130
const tmpFileObject = tmp.fileSync();
131
+ const pathToRequire = path.resolve(this.webpackConfig.getContext(), this.webpackConfig.sharedCommonsEntryFile);
132
fs.writeFileSync(
133
tmpFileObject.name,
- // quotes in the filename would cause problems
134
- `require('${path.resolve(this.webpackConfig.getContext(), this.webpackConfig.sharedCommonsEntryFile)}')`
+ // escape single quotes (x27) and backslashes
135
+ `require('${pathToRequire.replace(/\x27/g, '\\\x27').replace('/\\/g', '\\\\')}')`
136
);
137
138
entry[sharedEntryTmpName] = tmpFileObject.name;
0 commit comments