Как получить выходные данные config.devtool = 'source-map', используя новый webpack.SourceMapDevToolPlugin () - PullRequest
0 голосов
/ 06 июня 2019

Мне нужно настроить имя файла и добавить собственный sourceMappingURL, чтобы мне понадобилось для использования webpack.SourceMapDevToolPlugin, однако я не вижу, как настроить его для вывода того же стиля исходных карт, что и для более простого config.devtool = 'source-map'

В частности:

Не идеально (генерируется webpack.SourceMapDevToolPlugin):

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.acceptQuote = exports.getQuote = exports.getNewQuote = exports.getPayOutMethods = exports.getAllPayInMethods = exports.getPayInMethods = exports.getLimits = undefined;

var _http = __webpack_require__(/*! common-js/lib/utils/http */ "../common-js/lib/utils/http.js");

var _http2 = _interopRequireDefault(_http);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }

var getLimits = exports.getLimits = function getLimits(countryCode, currencyCode, direction, methodCode) {
  return function (dispatch, getState) {

    var state = getState();
    var authenticated = state.session && state.session.loggedIn;
    dispatch({ type: "SET_FLOW_BUSY" });
    _http2.default.get(authenticated, "v1/limit?country=" + countryCode + "&currency=" + currencyCode + "&direction=" + direction + "&method=" + methodCode).then(function (response) {
      dispatch({ type: "SET_LIMITS", limits: response.data });
      dispatch({ type: "SET_FLOW_DONE" });
    }).catch(function (err) {
      dispatch({ type: "SET_FLOW_ERROR", error: err });
      console.error(err);
    });
  };
};{ arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }

Идеально (генерируется config.devtool = 'source-map'):

import RestApi from 'common-js/lib/utils/http'

export const getLimits = (countryCode, currencyCode, direction, methodCode) => {
  return (dispatch, getState) => {


    const state = getState()
    const authenticated = state.session && state.session.loggedIn
    dispatch({ type: "SET_FLOW_BUSY" })
    RestApi.get(authenticated, `v1/limit?country=${countryCode}&currency=${currencyCode}&direction=${direction}&method=${methodCode}`)
      .then(response => {
        dispatch({ type: "SET_LIMITS", limits: response.data });
        dispatch({ type: "SET_FLOW_DONE" })
      })
      .catch(err => {
        dispatch({ type: "SET_FLOW_ERROR", error: err })
        console.error(err)
      })
  }
}

Как настроить webpack.SourceMapDevToolPlugin для создания вывода, например config.devtool = 'source-map' ??

Заранее спасибо.

...