-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: finish up scripts for server and build
Now we need to hook into commander.js.
- Loading branch information
Showing
12 changed files
with
490 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** Declaration file generated by dts-gen */ | ||
|
||
export = webpack_dashboard; | ||
|
||
declare namespace webpack_dashboard { | ||
namespace prototype { | ||
function clear(...args: any[]): void; | ||
|
||
function layoutAssets(...args: any[]): void; | ||
|
||
function layoutLog(...args: any[]): void; | ||
|
||
function layoutModules(...args: any[]): void; | ||
|
||
function layoutProblems(...args: any[]): void; | ||
|
||
function layoutStatus(...args: any[]): void; | ||
|
||
function mapNavigationKeysToScrollLog(...args: any[]): void; | ||
|
||
function setData(...args: any[]): void; | ||
|
||
function setLog(...args: any[]): void; | ||
|
||
function setOperations(...args: any[]): void; | ||
|
||
function setProblems(...args: any[]): void; | ||
|
||
function setProblemsError(...args: any[]): void; | ||
|
||
function setProgress(...args: any[]): void; | ||
|
||
function setSizes(...args: any[]): void; | ||
|
||
function setSizesError(...args: any[]): void; | ||
|
||
function setStats(...args: any[]): void; | ||
|
||
function setStatus(...args: any[]): void; | ||
|
||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare module 'webpack-dashboard/plugin' { | ||
import * as Tapable from 'tapable'; | ||
export default class DashboardPlugin extends Tapable.Tapable{} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import webpack from 'webpack'; | ||
import { CreateWebpackConfig } from '../config/CreateWebpackConfig'; | ||
import { ProjectConfig } from '../config/project.config.default'; | ||
import { ServerConfig } from '../config/server.config.default'; | ||
|
||
export class Build { | ||
private projectConfig: ProjectConfig; | ||
private serverConfig: ServerConfig; | ||
|
||
constructor(projectConfig: ProjectConfig, serverConfig: ServerConfig) { | ||
this.projectConfig = projectConfig; | ||
this.serverConfig = serverConfig; | ||
} | ||
|
||
/** | ||
* Build the files. | ||
*/ | ||
public build(): Promise<string> { | ||
return new Promise((resolve, reject) => { | ||
const config = new CreateWebpackConfig( | ||
this.projectConfig, | ||
this.serverConfig, | ||
false | ||
); | ||
const compiler = webpack( | ||
config.getConfig() as webpack.Configuration | ||
); | ||
compiler.run((err, stats) => { | ||
if (err || stats.hasErrors()) { | ||
reject(stats.toString({ colors: true })); | ||
} | ||
resolve( | ||
stats.toString({ | ||
colors: true, | ||
assets: true, | ||
chunks: true, | ||
}) | ||
); | ||
}); | ||
}); | ||
} | ||
} |
Oops, something went wrong.