3
3
const fs = require ( 'fs' ) ;
4
4
const path = require ( 'path' ) ;
5
5
const MemoryFileSystem = require ( 'memory-fs' ) ;
6
- const pathabs = require ( 'path-is-absolute' ) ;
7
6
const { colors } = require ( 'webpack-log' ) ;
8
7
const NodeOutputFileSystem = require ( 'webpack/lib/node/NodeOutputFileSystem' ) ;
9
8
const DevMiddlewareError = require ( './DevMiddlewareError' ) ;
@@ -27,7 +26,7 @@ module.exports = {
27
26
for ( const assetPath of Object . keys ( assets ) ) {
28
27
const asset = assets [ assetPath ] ;
29
28
const source = asset . source ( ) ;
30
- const isAbsolute = pathabs ( assetPath ) ;
29
+ const isAbsolute = path . isAbsolute ( assetPath ) ;
31
30
const writePath = isAbsolute ? assetPath : path . join ( outputPath , assetPath ) ;
32
31
const relativePath = path . relative ( process . cwd ( ) , writePath ) ;
33
32
const allowWrite = filter && typeof filter === 'function' ? filter ( writePath ) : true ;
@@ -54,7 +53,7 @@ module.exports = {
54
53
} ,
55
54
56
55
setFs ( context , compiler ) {
57
- if ( typeof compiler . outputPath === 'string' && ! pathabs . posix ( compiler . outputPath ) && ! pathabs . win32 ( compiler . outputPath ) ) {
56
+ if ( typeof compiler . outputPath === 'string' && ! path . posix . isAbsolute ( compiler . outputPath ) && ! path . win32 . isAbsolute ( compiler . outputPath ) ) {
58
57
throw new DevMiddlewareError ( '`output.path` needs to be an absolute path or `/`.' ) ;
59
58
}
60
59
0 commit comments