Skip to content

Commit 0b86e70

Browse files
vegerotfangbinwei
andauthored
types(vue.config.js): add descriptions for config (#5967)
Adding descriptions for vue.config.js so that editor can provide more parameter info Co-authored-by: Binwei Fang <[email protected]>
1 parent d03169c commit 0b86e70

File tree

1 file changed

+101
-1
lines changed

1 file changed

+101
-1
lines changed

packages/@vue/cli-service/types/ProjectOptions.d.ts

+101-1
Original file line numberDiff line numberDiff line change
@@ -23,37 +23,137 @@ interface ExtractOptions {
2323
}
2424

2525
interface CSSOptions {
26+
/**
27+
* Default: `true`
28+
*
29+
* By default, only files that ends in `*.module.[ext]` are treated as CSS modules
30+
*/
2631
requireModuleExtension?: boolean;
32+
/**
33+
* Default: `true`
34+
*
35+
* Whether to extract CSS in your components into a standalone CSS files (instead of inlined in JavaScript and injected dynamically)
36+
*/
2737
extract?: boolean | ExtractOptions;
38+
/**
39+
* Default: `false`
40+
*
41+
* Whether to enable source maps for CSS. Setting this to `true` may affect build performance
42+
*/
2843
sourceMap?: boolean;
44+
/**
45+
* Default: `{}`
46+
*
47+
* Pass options to CSS-related loaders
48+
*/
2949
loaderOptions?: LoaderOptions;
3050
}
3151

3252
interface ProjectOptions {
53+
/**
54+
* Default: `'/'`
55+
*
56+
* The base URL your application bundle will be deployed at
57+
*/
3358
publicPath?: string;
59+
/**
60+
* Default: `'dist'`
61+
*
62+
* The directory where the production build files will be generated in when running `vue-cli-service build`
63+
*/
3464
outputDir?: string;
65+
/**
66+
* Default: `''`
67+
*
68+
* A directory (relative to `outputDir`) to nest generated static assets (js, css, img, fonts) under
69+
*/
3570
assetsDir?: string;
71+
/**
72+
* Default: `'index.html'`
73+
*
74+
* Specify the output path for the generated `index.html` (relative to `outputDir`). Can also be an absolute path
75+
*/
3676
indexPath?: string;
77+
/**
78+
* Default: `true`
79+
*
80+
* By default, generated static assets contains hashes in their filenames for better caching control
81+
*/
3782
filenameHashing?: boolean;
83+
/**
84+
* Default: `false`
85+
*
86+
* Whether to use the build of Vue core that includes the runtime compiler
87+
*/
3888
runtimeCompiler?: boolean;
89+
/**
90+
* Default: `[]`
91+
*
92+
* If you want to explicitly transpile a dependency with Babel, you can list it in this option
93+
*/
3994
transpileDependencies?: Array<string | RegExp>;
95+
/**
96+
* Default: `true`
97+
*
98+
* Setting this to `false` can speed up production builds if you don't need source maps for production
99+
*/
40100
productionSourceMap?: boolean;
101+
/**
102+
* Default: `require('os').cpus().length > 1`
103+
*
104+
* Whether to use `thread-loader` for Babel or TypeScript transpilation
105+
*/
41106
parallel?: boolean | number;
42-
devServer?: object;
107+
/**
108+
* [All options for `webpack-dev-server`](https://webpack.js.org/configuration/dev-server/) are supported
109+
*/
110+
devServer?: { proxy: string | object, [key: string]: any };
111+
/**
112+
* Default: `undefined`
113+
*
114+
* Build the app in multi-page mode
115+
*/
43116
pages?: {
44117
[key: string]: PageEntry | PageConfig;
45118
};
119+
/**
120+
* Default: `undefined`
121+
*
122+
* Configure the `crossorigin` attribute on `<link rel="stylesheet">` and `<script>` tags in generated HTML
123+
*/
46124
crossorigin?: '' | 'anonymous' | 'use-credentials';
125+
/**
126+
* Default: `false`
127+
*
128+
* Set to `true` to enable [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) (SRI) on `<link rel="stylesheet">` and `<script>` tags in generated HTML
129+
*/
47130
integrity?: boolean;
48131

49132
css?: CSSOptions;
50133

134+
/**
135+
* A function that will receive an instance of `ChainableConfig` powered by [webpack-chain](https://github.com/mozilla-neutrino/webpack-chain)
136+
*/
51137
chainWebpack?: (config: ChainableWebpackConfig) => void;
138+
/**
139+
* Set webpack configuration. If the value is `Object`, will be merged into config. If value is `Function`, will receive current config as argument
140+
*/
52141
configureWebpack?: WebpackOptions | ((config: WebpackOptions) => (WebpackOptions | void));
53142

143+
/**
144+
* Default: `'default'`
145+
*
146+
* Whether to perform lint-on-save during development using [eslint-loader](https://github.com/webpack-contrib/eslint-loader)
147+
*/
54148
lintOnSave?: boolean | 'default' | 'warning' | 'error';
149+
/**
150+
* Pass options to the [PWA Plugin](https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa)
151+
*/
55152
pwa?: object;
56153

154+
/**
155+
* This is an object that doesn't go through any schema validation, so it can be used to pass arbitrary options to 3rd party plugins
156+
*/
57157
pluginOptions?: object;
58158
}
59159

0 commit comments

Comments
 (0)