‘liusuyi’
2023-08-09 161b9318e345c8a0c9cdc133b33a1c759495f323
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import ChainableWebpackConfig from 'webpack-chain'
import { WebpackOptions } from 'webpack/declarations/WebpackOptions'
 
type PageEntry = string | string[];
 
interface PageConfig {
  entry: PageEntry;
  [key: string]: any;
}
 
interface LoaderOptions {
  css?: object;
  sass?: object;
  less?: object;
  stylus?: object;
  postcss?: object;
}
 
// mini-css-extract-plugin options
interface ExtractOptions {
  filename?: string;
  chunkFilename?: string;
}
 
interface CSSOptions {
  requireModuleExtension?: boolean;
  extract?: boolean | ExtractOptions;
  sourceMap?: boolean;
  loaderOptions?: LoaderOptions;
}
 
export interface ProjectOptions {
  publicPath?: string;
  outputDir?: string;
  assetsDir?: string;
  indexPath?: string;
  filenameHashing?: boolean;
  runtimeCompiler?: boolean;
  transpileDependencies?: Array<string | RegExp>;
  productionSourceMap?: boolean;
  parallel?: boolean | number;
  devServer?: object;
  pages?: {
    [key: string]: PageEntry | PageConfig;
  };
  crossorigin?: '' | 'anonymous' | 'use-credentials';
  integrity?: boolean;
 
  css?: CSSOptions;
 
  chainWebpack?: (config: ChainableWebpackConfig) => void;
  configureWebpack?: WebpackOptions | ((config: WebpackOptions) => (WebpackOptions | void));
 
  lintOnSave?: boolean | 'default' | 'warning' | 'error';
  pwa?: object;
 
  pluginOptions?: object;
}
 
export type ConfigFunction = () => ProjectOptions