Skip to content

Commit

Permalink
Merge pull request #34 from sveltejs/posixify-tmp-paths
Browse files Browse the repository at this point in the history
posixify tmp css paths, for sake of windows
  • Loading branch information
Rich-Harris authored Dec 20, 2017
2 parents 0a800b8 + ffcb638 commit 6aef4da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { basename, extname, join } = require('path');
const { basename, extname, posix } = require('path');
const { compile, preprocess } = require('svelte');
const { getOptions } = require('loader-utils');
const { statSync, utimesSync, writeFileSync } = require('fs');
Expand Down Expand Up @@ -36,7 +36,7 @@ module.exports = function(source, map) {
let { code, map, css, cssMap, ast } = compile(processed.toString(), options);

if (options.emitCss && css) {
const tmpFile = join(tmpdir(), 'svelte-' + ast.hash + '.css');
const tmpFile = posix.join(tmpdir(), 'svelte-' + ast.hash + '.css');

css += '\n/*# sourceMappingURL=' + cssMap.toUrl() + '*/';
code = code + `\nrequire('${tmpFile}');\n`;
Expand Down

0 comments on commit 6aef4da

Please sign in to comment.