@appsemble/webpack-config
TypeScript icon, indicating that this package has built-in type declarations

0.24.13 • Public • Published

Appsemble Webpack Configuration

An opinionated reusable Webpack configuration for block development

npm GitLab CI Prettier

Table of Contents

Installation

npm install @appsemble/webpack-config

Usage

No setup is needed to use this configuration. @appsemble/cli will automatically fall back to this configuration if no webpack file has been specified in the .appsemblerc.yaml of the block and no webpack.config.js file exists.

This Webpack preset features:

TypeScript

In order to add support for static assets and CSS modules, use the following tsconfig.json options:

{
  "compilerOptions": {
    "types": ["@appsemble/webpack-config/types"]
  }
}

Manual Adjustments

Since a Webpack configuration is a function that returns a Webpack configuration, this preset can be overridden by simply calling it from a file named webpack.config.js in the block root and modifying the result.

import createConfig from '@appsemble/webpack-config';
import ImageMinimizerPlugin from 'image-minimizer-webpack-plugin';

export default function webpackConfig(blockConfig, options) {
  const config = createConfig(blockConfig, options);

  // Add a plugin for example
  config.plugins.push(new ImageMinimizerPlugin());

  // Or configure a fallback
  config.resolve.alias.fallback.fs = false;

  return config;
}

License

LGPL-3.0-only © Appsemble

Package Sidebar

Install

npm i @appsemble/webpack-config

Weekly Downloads

479

Version

0.24.13

License

LGPL-3.0-only

Unpacked Size

16 kB

Total Files

6

Last publish

Collaborators

  • ekhorn
  • remcohaszing
  • kvdb
  • appsemble-bot