@splunk/webpack-configs
v7.0.2
Published
Standardized webpack configuration files for apps and components
Downloads
6,276
Readme
@splunk/webpack-configs
Standardized webpack configuration files for apps and components.
Install
Install the package and its dependencies.
- Install the peer dependencies:
npm install --save-dev @babel/core@^7 babel-loader@^8 webpack@^4
- 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 thebabel-loader
configuration used by all configurations. Defaults totrue
.
const webpackMerge = require('webpack-merge');
const createBaseConfig = require('@splunk/webpack-configs').create;
module.exports = webpackMerge(createBaseConfig({ babelTypescript: false }), {
entry: {...},
output: {...},
});