Skip to content

Commit b61ea45

Browse files
authoredJan 30, 2019
feat: add typings for vue.config.js options (#3387)
1 parent 09be0f2 commit b61ea45

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed
 

‎packages/@vue/cli-service/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "3.3.0",
44
"description": "local service for vue-cli projects",
55
"main": "lib/Service.js",
6+
"typings": "types/index.d.ts",
67
"bin": {
78
"vue-cli-service": "bin/vue-cli-service.js"
89
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import ChainableWebpackConfig from 'webpack-chain'
2+
import { WebpackOptions } from 'webpack/declarations/WebpackOptions'
3+
4+
type PageEntry = string;
5+
6+
interface PageConfig {
7+
entry: PageEntry;
8+
[key: string]: any;
9+
}
10+
11+
interface LoaderOptions {
12+
css?: object;
13+
sass?: object;
14+
less?: object;
15+
stylus?: object;
16+
postcss?: object;
17+
}
18+
19+
// mini-css-extract-plugin options
20+
interface ExtractOptions {
21+
filename?: string;
22+
chunkFilename?: string;
23+
}
24+
25+
interface CSSOptions {
26+
modules?: boolean;
27+
extract?: boolean | ExtractOptions;
28+
sourceMap?: boolean;
29+
loaderOptions?: LoaderOptions;
30+
}
31+
32+
export interface ProjectOptions {
33+
publicPath?: string;
34+
outputDir?: string;
35+
assetsDir?: string;
36+
indexPath?: string;
37+
filenameHashing?: boolean;
38+
runtimeCompiler?: boolean;
39+
transpileDependencies?: Array<string | RegExp>;
40+
productionSourceMap?: boolean;
41+
parallel?: boolean;
42+
devServer?: object;
43+
pages?: {
44+
[key: string]: PageEntry | PageConfig;
45+
};
46+
crossorigin?: '' | 'anonymous' | 'use-credentials';
47+
integrity?: boolean;
48+
49+
css?: CSSOptions;
50+
51+
chainWebpack?: (config: ChainableWebpackConfig) => void;
52+
configureWebpack?: WebpackOptions | ((config: WebpackOptions) => (WebpackOptions | void));
53+
54+
lintOnSave?: boolean | 'error';
55+
pwa?: object;
56+
57+
pluginOptions?: object;
58+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { ProjectOptions } from './ProjectOptions'

0 commit comments

Comments
 (0)
Please sign in to comment.