Skip to content

Commit

Permalink
fixes sveltejs#65
Browse files Browse the repository at this point in the history
  • Loading branch information
ekhaled committed Aug 24, 2018
1 parent fa31326 commit 56cb185
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { basename, extname, relative } = require('path');
const { compile, preprocess } = require('svelte');
const { getOptions } = require('loader-utils');
const VirtualModules = require('./lib/virtual');
const requireRelative = require('require-relative');

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

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

options.filename = this.resourcePath;
if (!('format' in options)) options.format = 'es';
if (!('shared' in options)) options.shared = options.format === 'es' && 'svelte/shared.js';
if (!('shared' in options)) options.shared = options.format === 'es' && requireRelative.resolve('svelte/shared.js', process.cwd());
if (!('name' in options)) options.name = capitalize(sanitize(options.filename));
if (!('onwarn' in options)) options.onwarn = warning => this.emitWarning(new Error(warning));
if (options.emitCss) options.css = false;
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
],
"dependencies": {
"loader-utils": "^1.1.0",
"require-relative": "^0.8.7",
"svelte-dev-helper": "^1.1.7"
},
"devDependencies": {
Expand Down

0 comments on commit 56cb185

Please sign in to comment.