Skip to content

types(vue.config.js): add descriptions for config #5967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 2, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 84 additions & 1 deletion packages/@vue/cli-service/types/ProjectOptions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,120 @@ interface ExtractOptions {
}

interface CSSOptions {
/**
* Default: `true`
* By default, only files that ends in `*.module.[ext]` are treated as CSS modules
*/
requireModuleExtension?: boolean;
/**
* Default: `true`
* Whether to extract CSS in your components into a standalone CSS files (instead of inlined in JavaScript and injected dynamically)
*/
extract?: boolean | ExtractOptions;
/**
* Default: `true`
* Whether to enable source maps for CSS. Setting this to `true` may affect build performance
*/
sourceMap?: boolean;
/**
* Default: `{}`
* Pass options to CSS-related loaders
*/
loaderOptions?: LoaderOptions;
}

interface ProjectOptions {
/**
* Default: `'/'`
* The base URL your application bundle will be deployed at
*/
publicPath?: string;
/**
* Default: `'dist'`
* The directory where the production build files will be generated in when running `vue-cli-service build`
*/
outputDir?: string;
/**
* Default: `''`
* A directory (relative to `outputDir`) to nest generated static assets (js, css, img, fonts) under
*/
assetsDir?: string;
/**
* Default: `'index.html'`
* Specify the output path for the generated `index.html` (relative to `outputDir`). Can also be an absolute path
*/
indexPath?: string;
/**
* Default: `true`
* By default, generated static assets contains hashes in their filenames for better caching control
*/
filenameHashing?: boolean;
/**
* Default: `false`
* Whether to use the build of Vue core that includes the runtime compiler
*/
runtimeCompiler?: boolean;
/**
* Default: `[]`
* If you want to explicitly transpile a dependency with Babel, you can list it in this option
*/
transpileDependencies?: Array<string | RegExp>;
/**
* Default: `true`
* Setting this to `false` can speed up production builds if you don't need source maps for production
*/
productionSourceMap?: boolean;
/**
* Default: `require('os').cpus().length > 1`
* Whether to use `thread-loader` for Babel or TypeScript transpilation
*/
parallel?: boolean | number;
devServer?: object;
/**
* [All options for `webpack-dev-server`](https://webpack.js.org/configuration/dev-server/) are supported
*/
devServer?: { proxy: string | object, [key: string]: any };
/**
* Default: `undefined`
* Build the app in multi-page mode
*/
pages?: {
[key: string]: PageEntry | PageConfig;
};
/**
* Default: `undefined`
* Configure the `crossorigin` attribute on `<link rel="stylesheet">` and `<script>` tags in generated HTML
*/
crossorigin?: '' | 'anonymous' | 'use-credentials';
/**
* Default: `false`
* 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
*/
integrity?: boolean;

css?: CSSOptions;

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

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

/**
* 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
*/
pluginOptions?: object;
}

Expand Down