File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 11const path = require ( 'path' ) ;
2+ const upath = require ( 'upath' ) ;
23const relative = require ( 'relative' ) ;
34
45function MpvuePlugin ( ) { }
@@ -15,9 +16,10 @@ MpvuePlugin.prototype.apply = function(compiler) {
1516 chunks . reverse ( ) . forEach ( chunk => {
1617 chunk . files . forEach ( childFile => {
1718 if ( path . extname ( childFile ) === extname && compilation . assets [ filePath ] ) {
18- content = extname === '.wxss' ?
19- `@import "${ relative ( filePath , childFile ) } ";\n${ content } `
20- : `require("${ relative ( filePath , childFile ) } ");\n${ content } ` ;
19+ const relativePath = upath . normalize ( relative ( filePath , childFile ) )
20+ content = extname === '.wxss' ?
21+ `@import "${ relativePath } ";\n${ content } `
22+ : `require("${ relativePath } ");\n${ content } ` ;
2123 }
2224 } )
2325 compilation . assets [ filePath ] . source = ( ) => content ;
@@ -28,4 +30,4 @@ MpvuePlugin.prototype.apply = function(compiler) {
2830 } ) ;
2931} ;
3032
31- module . exports = MpvuePlugin ;
33+ module . exports = MpvuePlugin ;
Original file line number Diff line number Diff line change 11{
22 "name" : " webpack-mpvue-asset-plugin" ,
3- "version" : " 0.0.2 " ,
3+ "version" : " 0.1.0 " ,
44 "main" : " index.js" ,
55 "directories" : {
66 "lib" : " lib"
2424 "homepage" : " https://github.com/mpvue/webpack-mpvue-asset-plugin#readme" ,
2525 "description" : " " ,
2626 "dependencies" : {
27- "relative" : " ^3.0.2"
27+ "relative" : " ^3.0.2" ,
28+ "upath" : " ^1.1.0"
2829 }
2930}
You can’t perform that action at this time.
0 commit comments