frontfire 0.3.1 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/FrontFire.js +7 -10
package/package.json
CHANGED
package/src/FrontFire.js
CHANGED
|
@@ -21,9 +21,6 @@ export default async function frontFire( isWatch, cfg = {} )
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
console.log( "Using root build dir:" )
|
|
25
|
-
console.log( rootBuildDir );
|
|
26
|
-
|
|
27
24
|
fse.ensureDirSync( rootBuildDir );
|
|
28
25
|
fse.ensureDirSync( `${rootBuildDir}${path.sep}debug` );
|
|
29
26
|
fse.ensureDirSync( `${rootBuildDir}${path.sep}release` );
|
|
@@ -35,7 +32,6 @@ export default async function frontFire( isWatch, cfg = {} )
|
|
|
35
32
|
|
|
36
33
|
if ( fs.statSync( dirToDelete ) )
|
|
37
34
|
{
|
|
38
|
-
console.log( "Cleaning build directory: " + dirToDelete );
|
|
39
35
|
fs.rmSync( dirToDelete, { recursive: true, force: true } );
|
|
40
36
|
}
|
|
41
37
|
}
|
|
@@ -56,8 +52,6 @@ export default async function frontFire( isWatch, cfg = {} )
|
|
|
56
52
|
esbuildOpts = _.get( config, 'release.esbuild' );
|
|
57
53
|
}
|
|
58
54
|
|
|
59
|
-
console.log( esbuildOpts );
|
|
60
|
-
|
|
61
55
|
let ctx = await esbuild.context( esbuildOpts );
|
|
62
56
|
|
|
63
57
|
if ( true === isWatch )
|
|
@@ -69,11 +63,14 @@ export default async function frontFire( isWatch, cfg = {} )
|
|
|
69
63
|
await ctx.watch();
|
|
70
64
|
let { host, port } = await ctx.serve(
|
|
71
65
|
{
|
|
72
|
-
servedir : `.${path.sep}${rootBuildDir}${path.sep}debug
|
|
66
|
+
servedir : `.${path.sep}${rootBuildDir}${path.sep}debug`,
|
|
67
|
+
// @todo use param for index.html
|
|
68
|
+
fallback : `.${path.sep}${rootBuildDir}${path.sep}debug${path.sep}index.html`
|
|
69
|
+
//onRequest : function ( ) { console.log( "Hello" ); }
|
|
73
70
|
}
|
|
74
71
|
);
|
|
75
72
|
|
|
76
|
-
// Then start a proxy server
|
|
73
|
+
// Then start a proxy server
|
|
77
74
|
http.createServer((req, res) => {
|
|
78
75
|
|
|
79
76
|
const options = {
|
|
@@ -81,7 +78,7 @@ export default async function frontFire( isWatch, cfg = {} )
|
|
|
81
78
|
port: port,
|
|
82
79
|
path: req.url,
|
|
83
80
|
method: req.method,
|
|
84
|
-
headers: req.headers
|
|
81
|
+
headers: req.headers
|
|
85
82
|
};
|
|
86
83
|
|
|
87
84
|
if ( 'php' === indexType && req.url === "/" && req.method.toLowerCase() === 'get' )
|
|
@@ -115,7 +112,7 @@ export default async function frontFire( isWatch, cfg = {} )
|
|
|
115
112
|
|
|
116
113
|
}).listen(3000);
|
|
117
114
|
|
|
118
|
-
console.log(
|
|
115
|
+
console.log( `> InfrontJS:http://localhost:${port}` );
|
|
119
116
|
}
|
|
120
117
|
else
|
|
121
118
|
{
|