mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-22 04:18:33 -05:00
feat: add typings for vue.config.js options (#3387)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
"version": "3.3.0",
|
||||
"description": "local service for vue-cli projects",
|
||||
"main": "lib/Service.js",
|
||||
"typings": "types/index.d.ts",
|
||||
"bin": {
|
||||
"vue-cli-service": "bin/vue-cli-service.js"
|
||||
},
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
import ChainableWebpackConfig from 'webpack-chain'
|
||||
import { WebpackOptions } from 'webpack/declarations/WebpackOptions'
|
||||
|
||||
type PageEntry = 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 {
|
||||
modules?: 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;
|
||||
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 | 'error';
|
||||
pwa?: object;
|
||||
|
||||
pluginOptions?: object;
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { ProjectOptions } from './ProjectOptions'
|
||||
Reference in New Issue
Block a user