From 8bd7b3bdec8354c1672123eb429c2b8d614a292e Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Tue, 19 Jan 2021 10:43:32 +0800 Subject: [PATCH] chore: update kkt config. --- .kktrc.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.kktrc.ts b/.kktrc.ts index 82502873..90198f7b 100644 --- a/.kktrc.ts +++ b/.kktrc.ts @@ -1,7 +1,6 @@ import path from 'path'; import webpack, {Configuration} from 'webpack'; -import { DevServerConfigFunction, LoaderConfOptions } from 'kkt'; -import WebpackDevServer from 'webpack-dev-server'; +import { LoaderConfOptions } from 'kkt'; import lessModules from '@kkt/less-modules'; import rawModules from '@kkt/raw-modules'; import scopePluginOptions from '@kkt/scope-plugin-options'; @@ -20,14 +19,8 @@ export default (conf: Configuration, env: string, options: LoaderConfOptions) => conf.plugins!.push(new webpack.DefinePlugin({ VERSION: JSON.stringify(pkg.version), })); - conf.output = { ...conf.output, publicPath: './' } + if (env === 'production') { + conf.output = { ...conf.output, publicPath: './' } + } return conf; } - - -export const devServer = (configFunction: DevServerConfigFunction) => (proxy: WebpackDevServer.ProxyConfigArrayItem[], allowedHost: string) => { - // Create the default config by calling configFunction with the proxy/allowedHost parameters - const config = configFunction(proxy, allowedHost); - // Return your customised Webpack Development Server config. - return config; -}