Skip to content

Commit

Permalink
chore: update kkt config.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jan 19, 2021
1 parent 8e724a6 commit 8bd7b3b
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions .kktrc.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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;
}

0 comments on commit 8bd7b3b

Please sign in to comment.