Skip to content

Commit dc931e2

Browse files
committed
fix(configuration): make default config work with yarn PnP
This change makes the default values for spriteModule and symbolModule use absolute paths so that they work with yarn plug n play ISSUES CLOSED: 344
1 parent 44bbcfe commit dc931e2

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

lib/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module.exports = {
5555
* @type {string}
5656
* @autoconfigured
5757
*/
58-
spriteModule: 'svg-sprite-loader/runtime/browser-sprite.build',
58+
spriteModule: require.resolve('../runtime/browser-sprite.build'),
5959

6060
/**
6161
* Path to symbol module.
@@ -65,7 +65,7 @@ module.exports = {
6565
* @type {string}
6666
* @autoconfigured
6767
*/
68-
symbolModule: 'svg-baker-runtime/browser-symbol',
68+
symbolModule: require.resolve('svg-baker-runtime/browser-symbol'),
6969

7070
/**
7171
* Generated export format:

lib/configurator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ const defaults = require('./config');
33
const utils = require('./utils');
44

55
const loaderDefaults = defaults.loader;
6-
const isomorphicSpriteModule = 'svg-sprite-loader/runtime/sprite.build';
7-
const isomorphicSymbolModule = 'svg-baker-runtime/symbol';
6+
const isomorphicSpriteModule = require.resolve('../runtime/sprite.build');
7+
const isomorphicSymbolModule = require.resolve('svg-baker-runtime/symbol');
88

99
const isTargetBrowser = target => target === 'web' || target === 'electron-renderer';
1010

test/configurator.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ describe('configurator', () => {
3838
strictEqual(config.symbolModule, loaderDefaults.symbolModule);
3939

4040
config = configure({ context, target: 'node' });
41-
strictEqual(config.spriteModule, 'svg-sprite-loader/runtime/sprite.build');
42-
strictEqual(config.symbolModule, 'svg-baker-runtime/symbol');
41+
strictEqual(config.spriteModule, require.resolve('../runtime/sprite.build'));
42+
strictEqual(config.symbolModule, require.resolve('svg-baker-runtime/symbol'));
4343
});
4444

4545
it('should properly autodetect extract mode', () => {

0 commit comments

Comments
 (0)