5.0.5 • Published 8 months ago

@repodog/webpack-config v5.0.5

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

@repodog/webpack-config

The Repodog webpack config.

npm version License: MIT

Install package and peer dependency

# terminal
npm install @repodog/webpack-config webpack --save-dev

Install optional dependencies

# terminal
npm install babel-loader --save-dev
# or
npm install swc-loader --save-dev

Use 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',
  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] }),
  entry: './src/index.ts',
  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] }),
};

Environment variables

NODE_ENV = 'production' || 'development' || 'test'

When set to 'prod' or 'production', source maps are omitted.

You cam also use the environment variables outlined in @repodog/babel-config or @repodog/swc-config to control what is output.

5.0.5

8 months ago

5.0.4

8 months ago

5.0.3

10 months ago

5.0.1

10 months ago

0.1.4-alpha-12345.0

10 months ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.0

1 year ago

0.1.1

1 year ago

0.0.8

1 year 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