我希望在编译时将参数传递到我的网站,具体取决于它是用于开发,测试还是实时。
所以我像这样构建我的应用程序(使用集成的DefinePlugin)
webpack --define WEBPACK_CONFIG.webserviceUrl="NARF"
并使用像这样的参数
declare const WEBPACK_CONFIG: any;
const config =
{
webserviceUrl : WEBPACK_CONFIG.webserviceUrl
};
export = config;
但是编译后的输出在我的值
附近有括号/***/ 243:
/***/ function(module, exports, __webpack_require__) {
"use strict";
const config = {
webserviceUrl: (NARF)
};
module.exports = config;
如何阻止Webpack向参数添加括号?