Skip to content

Commit 9d9c9bc

Browse files
authored
Merge pull request #69 from ekhaled/gh-65
fixes #65
2 parents fa31326 + ff7b866 commit 9d9c9bc

File tree

3 files changed

+242
-235
lines changed

3 files changed

+242
-235
lines changed

index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const { basename, extname, relative } = require('path');
22
const { compile, preprocess } = require('svelte');
33
const { getOptions } = require('loader-utils');
44
const VirtualModules = require('./lib/virtual');
5+
const requireRelative = require('require-relative');
56

67
const hotApi = require.resolve('./lib/hot-api.js');
78

@@ -95,7 +96,7 @@ module.exports = function(source, map) {
9596

9697
options.filename = this.resourcePath;
9798
if (!('format' in options)) options.format = 'es';
98-
if (!('shared' in options)) options.shared = options.format === 'es' && 'svelte/shared.js';
99+
if (!('shared' in options)) options.shared = options.format === 'es' && requireRelative.resolve('svelte/shared.js', process.cwd());
99100
if (!('name' in options)) options.name = capitalize(sanitize(options.filename));
100101
if (!('onwarn' in options)) options.onwarn = warning => this.emitWarning(new Error(warning));
101102
if (options.emitCss) options.css = false;

0 commit comments

Comments
 (0)