@bentley/webpack-tools-core

Set of Webpack Plugins and Loaders used for building iModel.js applications

Usage no npm install needed!

<script type="module">
  import bentleyWebpackToolsCore from 'https://cdn.skypack.dev/@bentley/webpack-tools-core';
</script>

README

webpack-tools-core

Copyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md for license terms and full copyright notice.

The webpack-tools-core contains a set of webpack loaders and plugins used to build iTwin.js backend and frontends.

The main entry point for building an iTwin.js backend is the @bentley/backend-webpack package and iTwin.js frontends should use @bentley/webpack-tools.

This package contains the following Loaders and Plugins:

Loaders

| Name | Description | | - | - | | strip-assert-loader | Removes all uses of @itwin/core-bentley assert() method from the webpack bundle. |

Plugins

| Name | Description | | - | - | | BackendDefaultsPlugin | Combines a set of Webpack plugins to use as defaults when building an iTwin.js backend. (Used in @bentley/backend-webpack). | | BanImportsPlugin | Bans any import that crosses the frontend/backend boundary | | CopyBentleyStaticResourcesPlugin | Copies static resources from '@bentley' scoped packages into the output folder. Used to copy "assets", "public" and other resource files. | | CopyExternalsPlugin | Copies all npm packages containing an external module (and their direct dependencies) to a node_modules directory next to the webpack output. | | PrettyLoggingPlugin | Formats the output messages to print better when running within Azure DevOps Pipelines. Flags any warnings as errors when running a CI build. | | WatchBackendPlugin | Reloads a frontend anytime its corresponding backend changes. | | IModeljsLibraryExportsPlugin | Promotes all module exports to the global scope, under a "__IMODELJS_INTERNALS_DO_NOT_USE" variable, with an "imjsSharedLib" in the package.json. |