@jpapini/webpack-config

2.6.2 • Public • Published

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

Package Sidebar

Install

npm i @jpapini/webpack-config

Weekly Downloads

2

Version

2.6.2

License

MIT

Unpacked Size

172 kB

Total Files

34

Last publish

Collaborators

  • jpapini