From 733b9b435a65fea42da4256523ae47e6611c99b6 Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Tue, 2 Jun 2015 18:46:28 -0400 Subject: [PATCH] resolve merge conflict --- src/Bundle.js | 7 ++++++- src/utils/normalizePlatform.js | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/utils/normalizePlatform.js diff --git a/src/Bundle.js b/src/Bundle.js index a89b180..276e347 100644 --- a/src/Bundle.js +++ b/src/Bundle.js @@ -11,6 +11,11 @@ import { defaultResolver, defaultExternalResolver } from './utils/resolvePath'; import { defaultLoader } from './utils/load'; import getExportMode from './utils/getExportMode'; import getIndentString from './utils/getIndentString'; +import { unixizePath } from './utils/normalizePlatform.js'; + +function badExports ( option, keys ) { + throw new Error( `'${option}' was specified for options.exports, but entry module has following exports: ${keys.join(', ')}` ); +} export default class Bundle { constructor ( options ) { @@ -357,7 +362,7 @@ export default class Bundle { // make sources relative. TODO fix this upstream? const dir = dirname( map.file ); map.sources = map.sources.map( source => { - return source ? relative( dir, source ) : null + return source ? unixizePath( relative( dir, source ) ) : null }); } diff --git a/src/utils/normalizePlatform.js b/src/utils/normalizePlatform.js new file mode 100644 index 0000000..b16f3a9 --- /dev/null +++ b/src/utils/normalizePlatform.js @@ -0,0 +1,6 @@ +import { sep } from "path"; + +export function unixizePath(path) { + if (sep==="/") return path; + return path.split(sep).join("/"); +}