# carl-pack

> A cli tool for building a typescript + react project

Latest version **0.0.5-alpha.0** (published 2020-04-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install carl-pack
pnpm add carl-pack
yarn add carl-pack
bun add carl-pack
```

Provides the command `carl-pack`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5-alpha.0 |
| Published | 2020-04-17 |
| First published | 2020-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 35 |
| Unpacked size | 40.4 KB |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | wander |
| Maintainers | wanderhuang |
| Keywords | webpack, typescript, carl-pack, carl |

## Links

- npm: https://www.npmjs.com/package/carl-pack
- Repository: https://github.com/WanderHuang/carl
- Homepage: https://github.com/WanderHuang/carl/tree/master/packages/carl-pack
- Issues: https://github.com/WanderHuang/carl/issues
- npm.io page: https://npm.io/package/carl-pack

## Dependencies (35)

- [less](https://npm.io/package/less.md) ^3.11.1
- [chalk](https://npm.io/package/chalk.md) ^4.0.0
- [eslint](https://npm.io/package/eslint.md) ^6.8.0
- [rimraf](https://npm.io/package/rimraf.md) ^3.0.2
- [webpack](https://npm.io/package/webpack.md) ^4.42.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.0
- [commander](https://npm.io/package/commander.md) ^5.0.0
- [css-loader](https://npm.io/package/css-loader.md) ^3.5.1
- [url-loader](https://npm.io/package/url-loader.md) ^4.1.0
- [file-loader](https://npm.io/package/file-loader.md) ^6.0.0
- [less-loader](https://npm.io/package/less-loader.md) ^5.0.0
- [post-loader](https://npm.io/package/post-loader.md) ^2.0.0
- [babel-eslint](https://npm.io/package/babel-eslint.md) 10.x
- [babel-loader](https://npm.io/package/babel-loader.md) ^8.1.0
- [style-loader](https://npm.io/package/style-loader.md) ^1.1.3
- [eslint-loader](https://npm.io/package/eslint-loader.md) ^4.0.0
- [postcss-loader](https://npm.io/package/postcss-loader.md) ^3.0.0
- [postcss-normalize](https://npm.io/package/postcss-normalize.md) ^8.0.1
- [postcss-preset-env](https://npm.io/package/postcss-preset-env.md) ^6.7.0
- [webpack-dev-server](https://npm.io/package/webpack-dev-server.md) ^3.10.3
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) 7.x
- [html-webpack-plugin](https://npm.io/package/html-webpack-plugin.md) ^4.0.4
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) 2.x
- [terser-webpack-plugin](https://npm.io/package/terser-webpack-plugin.md) ^2.3.5
- [babel-preset-react-app](https://npm.io/package/babel-preset-react-app.md) ^9.1.2
- [eslint-plugin-flowtype](https://npm.io/package/eslint-plugin-flowtype.md) 4.x
- [eslint-plugin-jsx-a11y](https://npm.io/package/eslint-plugin-jsx-a11y.md) 6.x
- [postcss-flexbugs-fixes](https://npm.io/package/postcss-flexbugs-fixes.md) ^4.2.0
- [eslint-config-react-app](https://npm.io/package/eslint-config-react-app.md) ^5.2.1
- [mini-css-extract-plugin](https://npm.io/package/mini-css-extract-plugin.md) ^0.9.0
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) 2.x
- [eslint-friendly-formatter](https://npm.io/package/eslint-friendly-formatter.md) ^4.0.1
- [eslint-plugin-react-hooks](https://npm.io/package/eslint-plugin-react-hooks.md) 2.x
- [progress-bar-webpack-plugin](https://npm.io/package/progress-bar-webpack-plugin.md) ^2.1.0
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) 2.x

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.0.5-alpha.0 (latest) — 2020-04-17
- 0.0.4-alpha.0 — 2020-04-15
- 0.0.3 — 2020-04-15
- 0.0.2 — 2020-04-15
- 0.0.1 — 2020-04-15

## README

# carl打包管理

- 底层技术
  - webpack 4
  - less
  - commander
  - typescript

通过封装一个基于webpack的打包工具，同时提供给用户自定义配置的能力，完成一个较完整的`ts + react + less`项目打包方案的整合。

## 使用方式

只需要很少的配置就可以完成一个项目的打包

- `.carlrc.js`

```js
const path = require('path');

module.exports = (env) => {
  const isProd = env === 'production';
  // 除了这些配置外，其他配置支持扩展plugins等
  return {
    publicPath: '/',
    // 自定义文件名
    filename: `[name]/js/[name].[${isProd ? 'contenthash': 'hash'}:8].js`,
    chunkFilename: '[name]/js/[name].[contenthash:8].chunk.js',
    imageFilename: '[name]/images/[name].[hash:8].[ext]',
    otherFilename: '[name]/media/[name].[hash:8].[ext]',
    cssFilename: '[name]/css/[name].[contenthash:8].css',
    cssChunkFilename: '[name]/css/[name].[contenthash:8].chunk.css',
    // resolveAlias: {
    //   '@': path.resolve(__dirname, 'src'),
    // },
    // default dist
    outDir: 'dist',
    devServer: {
      index: 'index.html',
      port: 9600,
      hot: true,
      historyApiFallback: {
        rewrites: [
          {
            from: /.*/g,
            to: '/'
          }
        ]
      },
    },
  }
}
```

- 其他

推荐采用的目录结构，可以在`carl-invoker`内获取到

---
_Source: https://npm.io/package/carl-pack · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
