1.5.8 • Published 10 months ago

@jpapini/webpack-config v1.5.8

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Webpack configuration

Custom Webpack configuration for bundling projects.

Available configurations:

  • React.js projects: createReactAppWebpackConfig
  • Nest.js projects: createNestAppWebpackConfig

How to use

  1. Install the package and its required peer dependencies:
pnpm add -D @jpapini/webpack-config @swc/core webpack webpack-cli webpack-dev-server
  1. Create a webpack.config.js file with the following content:

For ESM projects:

import url from 'node:url';
import { createNestAppWebpackConfig } from '@jpapini/webpack-config';

export default createNestAppWebpackConfig(url.fileURLToPath(new URL('.', import.meta.url)));

Or for CommonJS projects:

const path = require('node:path');

const { createNestAppWebpackConfig } = require('@jpapini/webpack-config');

module.exports = createNestAppWebpackConfig(path.resolve(__dirname));
  1. Edit the package.json file to add the following scripts:
{
    "scripts": {
        "dev": "webpack watch",
        "build": "webpack build"
    }
}

Author