New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

carl-pack

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

carl-pack

A cli tool for building a typescript + react project

latest
Source
npmnpm
Version
0.0.5-alpha.0
Version published
Maintainers
1
Created
Source

carl打包管理

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

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

使用方式

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

  • .carlrc.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内获取到

Keywords

webpack

FAQs

Package last updated on 17 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts