feat: add devServer option
BREAKING CHANGE: remove `port` option, use `devServer` option instead
This commit is contained in:
parent
83e421d63a
commit
b344e3ead3
@ -115,11 +115,12 @@ const createConfig = (params?: WebpackOptions): webpack.Configuration => {
|
||||
analyze = false,
|
||||
mainLoader,
|
||||
svgLoader,
|
||||
port = 3000,
|
||||
devtool = 'inline-source-map',
|
||||
plugins,
|
||||
loaders,
|
||||
devServer,
|
||||
} = params ?? {};
|
||||
|
||||
const {
|
||||
assets,
|
||||
html,
|
||||
@ -135,7 +136,6 @@ const createConfig = (params?: WebpackOptions): webpack.Configuration => {
|
||||
analyze,
|
||||
mainLoader,
|
||||
svgLoader,
|
||||
port,
|
||||
paths: {
|
||||
assets,
|
||||
html,
|
||||
@ -147,6 +147,7 @@ const createConfig = (params?: WebpackOptions): webpack.Configuration => {
|
||||
},
|
||||
plugins,
|
||||
loaders,
|
||||
devServer,
|
||||
};
|
||||
|
||||
const isDev = mode === 'development';
|
||||
|
||||
@ -217,7 +217,6 @@ declare namespace BabelLoader {
|
||||
type WebpackOptions = {
|
||||
mode: WebpackMode;
|
||||
paths: WebpackPaths;
|
||||
port: number;
|
||||
mainLoader?: WebpackMainLoaders;
|
||||
svgLoader?: 'inline' | 'svgr';
|
||||
analyze: boolean;
|
||||
@ -233,6 +232,7 @@ type WebpackOptions = {
|
||||
copyPlugin?: CopyPlugin.PluginOptions | 'off';
|
||||
ignorePlugin?: ConstructorParameters<typeof webpack.IgnorePlugin>[0] | 'off';
|
||||
analyzerPlugin?: BundleAnalyzerPlugin.Options | 'off';
|
||||
providePlugin?: ConstructorParameters<typeof webpack.ProvidePlugin>[0] | 'off';
|
||||
};
|
||||
loaders?: {
|
||||
esbuildLoader?: EsbuildLoaderOptions | 'off';
|
||||
@ -256,6 +256,7 @@ type WebpackOptions = {
|
||||
};
|
||||
};
|
||||
cache?: webpack.Configuration['cache'] | 'off';
|
||||
devServer?: webpack.Configuration['devServer'];
|
||||
};
|
||||
|
||||
type WebpackEnv = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user