Skip to content

Commit

Permalink
fix(configuration): make default config work with yarn PnP
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Mark Davis committed Apr 25, 2019
1 parent 44bbcfe commit dc931e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = {
* @type {string}
* @autoconfigured
*/
spriteModule: 'svg-sprite-loader/runtime/browser-sprite.build',
spriteModule: require.resolve('../runtime/browser-sprite.build'),

/**
* Path to symbol module.
Expand All @@ -65,7 +65,7 @@ module.exports = {
* @type {string}
* @autoconfigured
*/
symbolModule: 'svg-baker-runtime/browser-symbol',
symbolModule: require.resolve('svg-baker-runtime/browser-symbol'),

/**
* Generated export format:
Expand Down
4 changes: 2 additions & 2 deletions lib/configurator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const defaults = require('./config');
const utils = require('./utils');

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

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

Expand Down
4 changes: 2 additions & 2 deletions test/configurator.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ describe('configurator', () => {
strictEqual(config.symbolModule, loaderDefaults.symbolModule);

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

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

0 comments on commit dc931e2

Please sign in to comment.