This repository was archived by the owner on Nov 5, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 33 Author Tobias Koppers @sokra
44*/
55var path = require ( "path" ) ;
6+ var loaderUtils = require ( "loader-utils" ) ;
67module . exports = function ( content ) {
78 this . cacheable && this . cacheable ( ) ;
89 this . clearDependencies && this . clearDependencies ( ) ;
9- var loaderSign = this . request . indexOf ( "!" ) ;
10- var rawJs = this . request . substr ( loaderSign ) ; // including leading "!"
11- if ( this . web )
12- return "require(" + JSON . stringify ( path . join ( __dirname , "addScript" ) ) + ")" +
13- "(require(" +
14- JSON . stringify ( "raw" + rawJs ) + "))" ;
15- return "" ;
10+ var rawJs = loaderUtils . getRemainingRequest ( this ) ;
11+ return "require(" + JSON . stringify ( path . join ( __dirname , "addScript" + ( this . web ? ".web" : "" ) + ".js" ) ) + ")" +
12+ "(require(" +
13+ JSON . stringify ( "raw" + rawJs ) + "))" ;
1614}
1715module . exports . seperable = true ;
Original file line number Diff line number Diff line change 11{
22 "name" : " script-loader" ,
3- "version" : " 0.2 .0" ,
3+ "version" : " 0.3 .0" ,
44 "author" : " Tobias Koppers @sokra" ,
55 "description" : " script loader module for webpack" ,
66 "dependencies" : {
7- "raw-loader" : " 0.1.x"
7+ "raw-loader" : " 0.1.x" ,
8+ "loader-utils" : " 0.1.x"
89 },
910 "licenses" : [
1011 {
You can’t perform that action at this time.
0 commit comments