narraleaf
Version:
Create your visual novel with Electron and React
52 lines (51 loc) • 1.21 kB
TypeScript
/**
* Required:
* # Webpack
* - webpack
* - webpack-dev-server (optional)
*
* # React
* - html-webpack-plugin
*
* # Babel
* - babel-loader
* - @babel/core
* - @babel/preset-env
* - @babel/preset-react
* - @babel/preset-typescript
*
* # StyleSheet
* - style-loader
* - css-loader
*/
import { Configuration, RuleSetUse } from "webpack";
import { App } from "../../cli/app";
export declare enum WebpackMode {
Development = "development",
Production = "production"
}
export type BaseWebpackConfig = {
mode: WebpackMode;
entry: string;
outputDir: string;
outputFilename: string;
extensions: string[];
extend?: Configuration;
useCache?: boolean;
};
export declare class WebpackConfig {
config: BaseWebpackConfig;
modules: WebpackModule[];
plugins: any[];
node_modules: string[];
constructor(config: BaseWebpackConfig);
getConfiguration(app: App): Configuration;
useModule(module: WebpackModule): this;
usePlugin(plugin: any): this;
useNodeModule(module: string): this;
}
export declare abstract class WebpackModule {
abstract test: RegExp;
abstract exclude: RegExp;
abstract getLoader(app: App): RuleSetUse;
}