5.0.9 • Published 8 months ago
@repodog/webpack-config v5.0.9
@repodog/webpack-config
The Repodog webpack config.
Install package and peer dependency
# terminal
npm install @repodog/webpack-config webpack --save-devInstall optional dependencies
# terminal
npm install babel-loader webpack-cli --save-dev
# or
npm install swc-loader webpack-cli --save-devUse package
// package.json
{
"scripts": {
"build": "webpack --config ./webpack.config.cjs",
},
}With Babel
// webpack.config.cjs
const webpackConfig = require('@repodog/webpack-config');
module.exports = {
...webpackConfig({ compiler: 'babel-loader' }),
entry: './src/index.ts',
// or
entry: './src/index.js',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist'),
},
};With SWC
// webpack.config.cjs
const swcConfig = require('@repodog/swc-config');
const webpackConfig = require('@repodog/webpack-config');
module.exports = {
...webpackConfig({ compiler: ['swc-loader', swcConfig.ts] }),
entry: './src/index.ts',
// or
...webpackConfig({ compiler: ['swc-loader', swcConfig.js] }),
entry: './src/index.js',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist'),
},
};Bundle tests
// webpack.config.cjs
const swcConfig = require('@repodog/swc-config');
const webpackConfig = require('@repodog/webpack-config/test.cjs');
module.exports = {
...webpackConfig({ compiler: 'babel-loader' }),
// or
...webpackConfig({ compiler: ['swc-loader', swcConfig.ts] }),
// or
...webpackConfig({ compiler: ['swc-loader', swcConfig.js] }),
};Environment variables
DEBUG = 'true' || 'false'
Sets source-map-loader and SourceMapDevToolPlugin.
NODE_ENV = 'production' || 'development' || 'test'
When set to 'prod' or 'production', source maps are omitted.
You can also use the environment variables outlined in @repodog/babel-config or @repodog/swc-config to control what is output.
5.0.6
1 year ago
5.0.9
8 months ago
5.0.8
1 year ago
5.0.7
1 year ago
5.0.5
1 year ago
5.0.4
1 year ago
5.0.3
1 year ago
5.0.1
1 year ago
0.1.4-alpha-12345.0
1 year ago
0.1.3
2 years ago
0.1.2
2 years ago
0.1.0
2 years ago
0.1.1
2 years ago
0.1.0-unstable.0
2 years ago
0.0.8
2 years ago
0.0.5
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago