File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change 81
81
"react-transform-catch-errors" : " ^1.0.2" ,
82
82
"react-transform-hmr" : " ^1.0.4" ,
83
83
"redbox-react" : " ^1.2.2" ,
84
- "replace" : " ^0.3.0" ,
85
84
"stylelint" : " ^5.0.1" ,
86
85
"stylelint-config-standard" : " ^4.0.1" ,
87
86
"url-loader" : " ^0.5.7" ,
Original file line number Diff line number Diff line change 9
9
10
10
import path from 'path' ;
11
11
import gaze from 'gaze' ;
12
- import replace from 'replace' ;
13
12
import Promise from 'bluebird' ;
14
-
13
+ import fs from './lib/fs' ;
14
+ import pkg from '../package.json' ;
15
15
/**
16
16
* Copies static files such as robots.txt, favicon.ico to the
17
17
* output (build) folder.
@@ -22,16 +22,16 @@ async function copy({ watch } = {}) {
22
22
await Promise . all ( [
23
23
ncp ( 'src/public' , 'build/public' ) ,
24
24
ncp ( 'src/content' , 'build/content' ) ,
25
- ncp ( 'package.json' , 'build/package.json' ) ,
26
25
] ) ;
27
26
28
- replace ( {
29
- regex : '"start".*' ,
30
- replacement : '"start": "node server.js"' ,
31
- paths : [ 'build/package.json' ] ,
32
- recursive : false ,
33
- silent : false ,
34
- } ) ;
27
+ await fs . writeFile ( './build/package.json' , JSON . stringify ( {
28
+ private : true ,
29
+ engines : pkg . engines ,
30
+ dependencies : pkg . dependencies ,
31
+ scripts : {
32
+ start : 'node server.js' ,
33
+ } ,
34
+ } , null , 2 ) ) ;
35
35
36
36
if ( watch ) {
37
37
const watcher = await new Promise ( ( resolve , reject ) => {
You can’t perform that action at this time.
0 commit comments