Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Webpack

For building the swat web-uiwebuiwebpack is used.

Webpack configuration

...

copy-webpack-plugin wrapped by copyPlugin is used for static files / artifacts that require copying over (eg. images).

 

Example depicting code snippet of webpack.config.js:

...

By further expanding upon legacyBundler and copyPlugin plugins, used by webpack.config.js, we see the following config file structure:

Build output

When running webpack, the source files are outputted as of follow:

Image Added

The bundles are then included in the index.html:

Code Block
languagexml
titleindex.html
<!-- ... -->
  <head>
    <!-- ... -->
    <link rel="stylesheet" href="swat.vendor.css">
    <link rel="stylesheet" href="swat.bundle.css">
    <!-- ... -->
    <script type="text/javascript" src="swat.vendor.js"></script>
    <script type="text/javascript" src="swat.bundle.js"></script>
    <!-- ... -->
  </head>
<!-- ... -->