@ovh-ux/manager-webpack-config

7.0.2 • Public • Published

Manager Webpack Config

Extensible webpack configuration for the OVH Manager.

Downloads Dependencies Dev Dependencies

Install

yarn add -D @ovh-ux/manager-webpack-config

Usage

The webpack configuration can be imported and extended in the manager. To import the configuration, simply add manager-webpack-config as a devDependency.

In order to use and extends this configuration, some manager relative parameters needs to be provided. Please refer to the parameters and example below.

Parameters

The following configuration parameters needs to be provided:

The following configuration parameters are optionals:

  • assets.options: see https://github.com/webpack-contrib/copy-webpack-plugin
  • translationsRoot: by default, ui-router-translation loader resolves translations relatively to the current resource path. You can override this behavior by providing an absolute translationsRoot path. This path will then be used to resolve translations instead of current resource path.
  • lessJavascriptEnabled: adds javascriptEnabled option to the less compiler

Example

// import config and initialize parameters
const { config } = require('@ovh-ux/manager-webpack-config')({
  template: './client/index.html',
  basePath: './client',
  lessPath: ['./client/app', './client/components', './node_modules'],
  root: path.resolve(__dirname, './client/app'),
  assets: {
    files: [
      {
        from: path.resolve(__dirname, './client/app/common/assets'),
        to: 'assets',
      },
    ],
  },
});

// merge the configuration and export it
module.exports = merge(config, {
  entry: _.assign({
    main: './client/app/index.js',
  }),
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: '[name].[chunkhash].bundle.js',
  },
});

Related

Contributing

Always feel free to help out! Whether it's filing bugs and feature requests or working on some of the open issues, our contributing guide will help get you started.

License

BSD-3-Clause © OVH SAS

Dependencies (41)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @ovh-ux/manager-webpack-config

    Weekly Downloads

    10

    Version

    7.0.2

    License

    BSD-3-Clause

    Unpacked Size

    40.9 kB

    Total Files

    14

    Last publish

    Collaborators

    • jisay
    • blary_jp
    • antleblanc
    • cbourgois
    • ovh-ux-cds
    • lizardk
    • ovh
    • marie-j