4.0.0-alpha.0 • Published 6 years ago

handywebpack v4.0.0-alpha.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

handywebpack

npm build codecov download license Commitizen friendly Conventional Commits

A simple configuration build tool for webpack.

Install

$ npm i webpackhandy -D

Usage

const Path = require('path');
const { CreateWebpackConfig } = require('webpackhandy');

const rootPath = Path.join(__dirname);
const srcPath = Path.join(rootPath, 'src');
const outputPath = Path.join(rootPath, 'dist');

const webpackConfig = CreateWebpackConfig({
  mode: process.env.NODE_ENV,
  context: srcPath,
  entry: {
    main: Path.join(srcPath, 'entry1.js')
  },
  output: {
    path: outputPath
  }
}, {
  plugins: {
    HtmlWebpackPlugin: {
      template: Path.join(srcPath, 'index.html'),
      filename: Path.join(outputPath, 'index.html')
    }
  }
});

module.exports = webpackConfig;

License

MIT