kkt
Create React apps with no build configuration, Cli tool for creating react apps.
Last updated a month ago by wcjiang .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install kkt 
SYNC missed versions from official npm registry.

Create React apps with no build configuration, Cli tool for creating react apps. Another tool, kkt-ssr, Is a lightweight framework for static and server-rendered applications.

Migrate from kkt 4.x to 5.x.

Features:

  • ⏱ The code was rewritten using TypeScript.
  • ♻️ Recompile the code when project files get added, removed or modified.
  • ???? Readable source code that encourages learning and contribution
  • ⚛️ Refactor code based on create-react-app.
  • ???? Expose the configuration file entry and support webpack configuration.
  • ???? Supports creat-kkt to create different instances.
  • ⛑ Jest test runner setup with defaults kkt test

Usage

You will need Node.js installed on your system.

npm install kkt

Example

Initialize the project from one of the examples, Let's quickly create a react application:

$ npx create-kkt my-app -e uiw
# or npm
$ npm create kkt my-app -e `<Example Name>`
# or yarn 
$ yarn create kkt my-app -e `<Example Name>`

Configuration

Supports kktrc.js and kktrc.ts.

import { Argv } from 'yargs';

export interface ClientEnvironment {
  raw: {
    NODE_ENV?: 'development' | 'production' | string;
    PUBLIC_URL?: string;
    IMAGE_INLINE_SIZE_LIMIT?: string;
  },
  stringified: {
    'process.env': ClientEnvironment['raw'],
  },
}
export interface OptionConf {
  env: string; // Environment variable
  dotenv: ClientEnvironment;
  isEnvDevelopment: boolean;
  isEnvProduction: boolean;
  shouldUseSourceMap: boolean;
  publicPath: string;
  publicUrl: string;
  useTypeScript: boolean;
  yargsArgs: Argv; // Command Parameter
  paths: {
    moduleFileExtensions: string[];
  };
  // conf.resolve.plugins `ModuleScopePlugin` options.
  moduleScopePluginOpts?: KKTRC['moduleScopePluginOpts'];
  MiniCssExtractPlugin: MiniCssExtractPlugin;
}

/**
 * Modify webpack config.
 * */
export default (conf: webpack.Configuration, options: OptionConf, webpack: typeof webpack) => {
  return conf;
}

/**
 * This is the setting for the Plug-in `new ModuleScopePlugin`.
 * 
 * Prevents users from importing files from outside of src/ (or node_modules/).
 * This often causes confusion because we only process files within src/ with babel.
 * To fix this, we prevent you from importing files out of src/ -- if you'd like to,
 * please link the files into your node_modules/ and let module-resolution kick in.
 * Make sure your source files are compiled, as they will not be processed in any way.
 * */
export const moduleScopePluginOpts = [
  path.resolve(process.cwd(), 'README.md'),
];

/**
 * Support for Less.
 * Opt-in support for Less (using `.scss` or `.less` extensions).
 * By default we support Less Modules with the
 * extensions `.module.less` or `.module.less`
 **/
export const loaderOneOf = [
  require.resolve('@kkt/loader-less'), // Support for less.
  require.resolve('@kkt/loader-scss'), // Support for scss.
  require.resolve('@kkt/loader-stylus'), // Support for stylus.
];

/**
 * mocker-api that creates mocks for REST APIs.
 * It will be helpful when you try to test your application without the actual REST API server.
 * https://github.com/jaywcjlove/mocker-api
 */
export const mocker = {
  path: string | string[];
  /**
   * https://github.com/jaywcjlove/mocker-api/tree/96c2eb94694571e0e3003e6ad9ce1c809499f577#options
   */
  option: MockerOption;
}

Home Page

Add homepage to package.json

The step below is important!

Open your package.json and add a homepage field for your project:

"homepage": "https://myusername.github.io/my-app",

or for a GitHub user page:

"homepage": "https://myusername.github.io",

or for a custom domain page:

"homepage": "https://mywebsite.com",

KKT uses the homepage field to determine the root URL in the built HTML file.

Loaders

License

MIT © Kenny Wong

Current Tags

  • 5.9.0                                ...           latest (a month ago)

125 Versions

  • 5.9.0                                ...           a month ago
  • 5.8.0                                ...           4 months ago
  • 5.7.1                                ...           4 months ago
  • 5.6.4                                ...           4 months ago
  • 5.6.3                                ...           4 months ago
  • 5.6.2                                ...           4 months ago
  • 5.6.1                                ...           5 months ago
  • 5.6.0                                ...           5 months ago
  • 5.5.5                                ...           5 months ago
  • 5.5.4                                ...           5 months ago
  • 5.5.3                                ...           5 months ago
  • 5.5.2                                ...           5 months ago
  • 5.5.1                                ...           6 months ago
  • 5.5.0                                ...           6 months ago
  • 5.4.3                                ...           6 months ago
  • 5.4.2                                ...           6 months ago
  • 5.4.1                                ...           6 months ago
  • 5.4.0                                ...           6 months ago
  • 5.3.0                                ...           7 months ago
  • 5.2.2                                ...           8 months ago
  • 5.2.1                                ...           8 months ago
  • 5.2.0                                ...           8 months ago
  • 5.1.0                                ...           8 months ago
  • 5.0.4                                ...           9 months ago
  • 5.0.3                                ...           9 months ago
  • 5.0.2                                ...           9 months ago
  • 5.0.0                                ...           9 months ago
  • 5.0.0-alpha.12                                ...           9 months ago
  • 5.0.0-alpha.11                                ...           9 months ago
  • 5.0.0-alpha.10                                ...           9 months ago
  • 5.0.0-alpha.9                                ...           9 months ago
  • 5.0.0-alpha.8                                ...           9 months ago
  • 5.0.0-alpha.7                                ...           9 months ago
  • 5.0.0-alpha.6                                ...           9 months ago
  • 5.0.0-alpha.5                                ...           9 months ago
  • 5.0.0-alpha.4                                ...           a year ago
  • 5.0.0-alpha.3                                ...           a year ago
  • 5.0.0-alpha.2                                ...           a year ago
  • 5.0.0-alpha.1                                ...           a year ago
  • 4.2.0                                ...           a year ago
  • 4.1.7                                ...           a year ago
  • 4.1.6                                ...           a year ago
  • 4.1.4                                ...           a year ago
  • 4.1.3                                ...           a year ago
  • 4.1.2                                ...           a year ago
  • 4.1.1                                ...           a year ago
  • 4.1.0                                ...           a year ago
  • 4.0.0                                ...           a year ago
  • 3.5.0                                ...           a year ago
  • 3.4.3                                ...           a year ago
  • 3.4.2                                ...           a year ago
  • 3.4.1                                ...           a year ago
  • 3.4.0                                ...           a year ago
  • 3.3.0                                ...           a year ago
  • 3.2.0                                ...           2 years ago
  • 3.1.1                                ...           2 years ago
  • 3.1.0                                ...           2 years ago
  • 3.0.1                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 3.0.0-beta.11                                ...           2 years ago
  • 3.0.0-beta.10                                ...           2 years ago
  • 3.0.0-beta.9                                ...           2 years ago
  • 3.0.0-beta.8                                ...           2 years ago
  • 3.0.0-beta.7                                ...           2 years ago
  • 3.0.0-beta.6                                ...           2 years ago
  • 3.0.0-beta.5                                ...           2 years ago
  • 3.0.0-beta.4                                ...           2 years ago
  • 3.0.0-beta.3                                ...           2 years ago
  • 3.0.0-beta.2                                ...           2 years ago
  • 3.0.0-beta.1                                ...           2 years ago
  • 2.1.3                                ...           2 years ago
  • 2.1.2                                ...           2 years ago
  • 2.1.1                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.8                                ...           2 years ago
  • 2.0.7                                ...           2 years ago
  • 2.0.6                                ...           2 years ago
  • 2.0.5                                ...           2 years ago
  • 2.0.4                                ...           2 years ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.9.29                                ...           2 years ago
  • 1.9.28                                ...           2 years ago
  • 1.9.27                                ...           2 years ago
  • 1.9.26                                ...           2 years ago
  • 1.9.25                                ...           2 years ago
  • 1.9.24                                ...           2 years ago
  • 1.9.23                                ...           2 years ago
  • 1.9.22                                ...           2 years ago
  • 1.9.21                                ...           2 years ago
  • 1.9.20                                ...           2 years ago
  • 1.9.19                                ...           2 years ago
  • 1.9.18                                ...           2 years ago
  • 1.9.17                                ...           2 years ago
  • 1.9.16                                ...           2 years ago
  • 1.9.15                                ...           2 years ago
  • 1.9.14                                ...           2 years ago
  • 1.9.13                                ...           2 years ago
  • 1.9.12                                ...           2 years ago
  • 1.9.11                                ...           2 years ago
  • 1.9.10                                ...           2 years ago
  • 1.9.9                                ...           2 years ago
  • 1.9.8                                ...           2 years ago
  • 1.9.7                                ...           2 years ago
  • 1.9.6                                ...           2 years ago
  • 1.9.5                                ...           2 years ago
  • 1.9.4                                ...           2 years ago
  • 1.9.3                                ...           2 years ago
  • 1.9.2                                ...           2 years ago
  • 1.9.1                                ...           2 years ago
  • 1.9.0                                ...           2 years ago
  • 1.8.0                                ...           2 years ago
  • 1.7.3                                ...           2 years ago
  • 1.7.2                                ...           2 years ago
  • 1.7.1                                ...           2 years ago
  • 1.7.0                                ...           2 years ago
  • 1.6.0                                ...           2 years ago
  • 1.5.0                                ...           2 years ago
  • 1.4.0                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 4
This Month 14
Last Day 3
Last Week 9
Last Month 417
Dependencies (75)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |