@splunk/webpack-configs

7.0.2 • Public • Published

@splunk/webpack-configs

Standardized webpack configuration files for apps and components.

Install

Install the package and its dependencies.

  1. Install the peer dependencies:
    npm install --save-dev @babel/core@^7 babel-loader@^8 webpack@^4
    
  2. Install the package:
    npm install --save-dev @splunk/webpack-configs
    

Usage

Base Configuration

const webpackMerge = require('webpack-merge');
const baseConfig = require('@splunk/webpack-configs').default;

module.exports = webpackMerge(baseConfig, {
    entry: {...},
    output: {...},
});

Component Library

A configuration for building a library of shareable components.

const webpackMerge = require('webpack-merge');
const baseComponentConfig = require('@splunk/webpack-configs/component.config').default;

module.exports = webpackMerge(baseComponentConfig, {
entry: {...},
output: {...},
});

Dashboard Extensions

const webpackMerge = require('webpack-merge');
const baseDashboardConfig = require('@splunk/webpack-configs/dashboard.config').default;

module.exports = webpackMerge(baseDashboardConfig, {
    entry: {...},
    output: {...},
});

@splunk/dashboard-extension-webpack-plugin must be added as a dev dependency if this configuration is used.

Options

All configurations export a create function that accepts the following options:

  • babelTypescript - Includes .ts and .tsx files in the babel-loader configuration used by all configurations. Defaults to true.
const webpackMerge = require('webpack-merge');
const createBaseConfig = require('@splunk/webpack-configs').create;

module.exports = webpackMerge(createBaseConfig({ babelTypescript: false }), {
    entry: {...},
    output: {...},
});

Readme

Keywords

none

Package Sidebar

Install

npm i @splunk/webpack-configs

Weekly Downloads

587

Version

7.0.2

License

Apache-2.0

Unpacked Size

23.4 kB

Total Files

7

Last publish

Collaborators

  • splunker
  • splunk_sui_publish