UNPKG

@midwayjs/build-plugin-hooks

Version:

Build integration plugin for Rax/Ice to convert references to backend Api in code to frontend SDK calls.

16 lines (11 loc) 407 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const buildHooksRequest = pluginApi => { pluginApi.onGetWebpackConfig(config => { const MidwayHooksLoader = require.resolve('@midwayjs/hooks-loader'); ['jsx', 'tsx'].forEach(type => { config.module.rule(type).use('midway-hooks').loader(MidwayHooksLoader); }); }); }; exports.default = buildHooksRequest;