Socket
Socket
Sign inDemoInstall

webpack-base-cli

Package Overview
Dependencies
38
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    webpack-base-cli

Use webpack to build project


Version published
Maintainers
1
Created

Readme

Source

webpack-base-cli

NPM version node Build Status codecov NPM downloads

Use webpack to build project

Installation

npm install --save-dev webpack-base-cli

Usage

webpack-base-cli build [options]

Command options

-p, --prod       Set production environment    [boolean] [default: false]
-c, --config     Set webpack config            [string]
-v, --version    Show version number
-h, --help       Show help

Example

webpack-base-cli build -p true  -c config.js
Description

Default configuration is recommended, including config.js, babel.config.js, postcss.config.js, browserslist.js and other files. You can also configure these files by yourself, provided they are placed in the root directory of your project.

The default configuration of config.js is roughly as follows:

const path = require('path');

const config = {
    path: {
        src: path.resolve(process.cwd(), 'src'),
        dev: path.resolve(process.cwd(), 'dev'),
        prod: path.resolve(process.cwd(), 'output'),
        devPublicPath: '/',
        prodPublicPath: '',
    },
    devServerPort: 8888,
    backEndServer: '',
    hash: '-[hash:6]',
    chunkhash: '-[chunkhash:6]',
    contenthash: '-[contenthash:6]',
    supportNewAPI: true,
    imageCompress: true,
    html: [{
        name: 'index.html',
        path: path.resolve(process.cwd(), 'src/index.html'),
    }],
    entry: {
        index: [path.resolve(process.cwd(), 'src/index.js')]
    },
    favicon: path.resolve(process.cwd(), 'src/favicon.ico'),
};

Note: generally speaking, you only need to configure path.prodPublicPath and backEndServer in your own config.js.

License

MIT.

Keywords

FAQs

Last updated on 17 Mar 2020

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc