@jpapini/webpack-config
v2.0.0
Published
Custom Webpack configuration for bundling projects.
Downloads
86
Maintainers
Readme
Webpack configuration
Custom Webpack configuration for bundling projects.
Available configurations:
- React.js projects:
createReactAppWebpackConfig
- Nest.js projects:
createNestAppWebpackConfig
How to use
- Install the package and its required peer dependencies:
pnpm add -D @jpapini/webpack-config @swc/core webpack webpack-cli webpack-dev-server
- 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));
- Edit the
package.json
file to add the following scripts:
{
"scripts": {
"dev": "webpack watch",
"build": "webpack build"
}
}
Author
- Julien Papini [email protected]