File tree 3 files changed +18
-4
lines changed
3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -370,6 +370,8 @@ Builder.prototype.json = function(fn){
370
370
if ( self . conf ) return fn ( null , self . conf ) ;
371
371
try {
372
372
self . conf = cache [ path ] = JSON . parse ( str ) ;
373
+ utils . normalizeConfig ( self . conf ) ;
374
+
373
375
// TODO: lame, remove me
374
376
if ( ! self . _emittedConfig ) {
375
377
self . _emittedConfig = true ;
Original file line number Diff line number Diff line change 10
10
exports . stripQuotes = function ( str ) {
11
11
if ( '"' == str [ 0 ] || "'" == str [ 0 ] ) return str . slice ( 1 , - 1 ) ;
12
12
return str ;
13
- } ;
13
+ } ;
14
+
15
+ /**
16
+ * Normalize `conf`.
17
+ *
18
+ * @param {Object } conf
19
+ * @api private
20
+ */
21
+
22
+ exports . normalizeConfig = function ( conf ) {
23
+ // support "./" in main
24
+ if ( conf . main ) conf . main = conf . main . replace ( / ^ \. \/ / , '' ) ;
25
+ } ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " main" ,
3
3
"version" : " 0.0.1" ,
4
- "scripts" : [" foo.js" , " bar.js" ],
5
- "main" : " foo.js"
6
- }
4
+ "scripts" : [" ./ foo.js" , " ./ bar.js" ],
5
+ "main" : " ./ foo.js"
6
+ }
You can’t perform that action at this time.
0 commit comments