Skip to content

Commit 82f15ac

Browse files
author
Robert Pocklington
committed
fix: bundle paths on windows (reverts #190)
1 parent a03c7bf commit 82f15ac

3 files changed

Lines changed: 5 additions & 11 deletions

File tree

src/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import path from 'path'
22
import { createFilter } from 'rollup-pluginutils'
33
import Concat from 'concat-with-sourcemaps'
44
import Loaders from './loaders'
5-
import normalizePath from './utils/normalize-path'
65

76
/**
87
* The options that could be `boolean` or `object`
@@ -166,13 +165,13 @@ export default (options = {}) => {
166165
const getExtracted = () => {
167166
let fileName = `${path.basename(file, path.extname(file))}.css`
168167
if (typeof postcssLoaderOptions.extract === 'string') {
169-
fileName = path.isAbsolute(postcssLoaderOptions.extract) ? normalizePath(path.relative(dir, postcssLoaderOptions.extract)) : normalizePath(postcssLoaderOptions.extract)
168+
fileName = path.isAbsolute(postcssLoaderOptions.extract) ? path.relative(dir, postcssLoaderOptions.extract) : postcssLoaderOptions.extract
170169
}
171170

172171
const concat = new Concat(true, fileName, '\n')
173172
const entries = [...extracted.values()]
174173
const { modules, facadeModuleId } = bundle[
175-
normalizePath(path.relative(dir, file))
174+
path.relative(dir, file)
176175
]
177176

178177
if (modules) {
@@ -186,7 +185,7 @@ export default (options = {}) => {
186185
}
187186

188187
for (const result of entries) {
189-
const relative = normalizePath(path.relative(dir, result.id))
188+
const relative = path.relative(dir, result.id)
190189
const map = result.map || null
191190
if (map) {
192191
map.file = fileName

src/postcss-loader.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import postcss from 'postcss'
44
import findPostcssConfig from 'postcss-load-config'
55
import { identifier } from 'safe-identifier'
66
import humanlizePath from './utils/humanlize-path'
7-
import normalizePath from './utils/normalize-path'
87

98
const styleInjectPath = require
109
.resolve('style-inject/dist/style-inject.es')
@@ -156,9 +155,6 @@ export default {
156155
}
157156

158157
const outputMap = result.map && JSON.parse(result.map.toString())
159-
if (outputMap && outputMap.sources) {
160-
outputMap.sources = outputMap.sources.map(v => normalizePath(v))
161-
}
162158

163159
let output = ''
164160
let extracted

src/utils/humanlize-path.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import path from 'path'
2-
import normalizePath from './normalize-path'
32

4-
const humanlizePath = filepath => normalizePath(path.relative(process.cwd(),
5-
filepath))
3+
const humanlizePath = filepath => path.relative(process.cwd(),
4+
filepath)
65

76
export default humanlizePath

0 commit comments

Comments
 (0)