Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27860] Webpack: Tap into hooks before/after other plugins

GitHub Issuen/a
TypeNew Feature
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2020-08-25T00:36:04.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.1.0
Componentsn/a
Labelsn/a
ReporterJan Vennemann
AssigneeJan Vennemann
Created2020-04-21T17:39:00.000+0000
Updated2020-08-25T00:36:04.000+0000

Description

For TIMOB-27858, plugins need the ability to tap into hooks before/after other plugins to ensure the order in which certain aspects of a plugin gets applied. This is especially important for chainWebpack to make sure the base configuration is present before other third-party plugins may try to modify it. *Default behavior* By default plugins are evaluated in series. Built-in plugins from appcd-plugin-webpack are always loaded first. Plugins from package.json are loaded in the order they are defined there. *API proposal* Add options argument as the last argument with after/before properties to control the order in which values will be applied.
module.exports = function (api, options) {
  api.chainWebpack(
    config => {
      config
	.entry('main')
	.add('./src/main.js')
	.end();
    },
    { after: 'built-in:config/prod' }
  );
};

Comments

  1. Jan Vennemann 2020-04-29

    PR: https://github.com/appcelerator/appcd-plugin-webpack/pull/12
  2. Lokesh Choudhary 2020-08-25

    Closing.

JSON Source