我有一个带有Plotly.JS图表的Angular(7+)应用程序。 由于密谋,我不得不使用自定义的webpack脚本和ify-loader(请参见plotly documentation)。
从那时起,我在构建时使用playerTimeOut: ?TimeoutID = null;
componentDidMount() {
const { children } = this.props;
const { index } = this.state;
this.playerTimeOut = setTimeout(() => {
clearTimeout(this.playerTimeOut);
this.setState({
index: index >= this.total ? 0 : index + 1
});
}, parseInt(children[index].attr.runningtime) * 1000);
}
会产生这种错误:
--aot
它们似乎都与材料组件有关。如果我不使用ERROR in ./node_modules/@angular/material/button/typings/index.ngfactory.js
Module build failed (from ./node_modules/ify-loader/index.js):
Error: Invalid name: "@angular/material/button"
at ensureValidName (.\node_modules\normalize-package-data\lib\fixer.js:335:15)
at Object.fixNameField (.\node_modules\normalize-package-data\lib\fixer.js:215:5)
at .\node_modules\normalize-package-data\lib\normalize.js:32:38
at Array.forEach (<anonymous>)
at normalize (.\node_modules\normalize-package-data\lib\normalize.js:31:15)
at final (.\node_modules\read-package-json\read-json.js:411:5)
at then (.\node_modules\read-package-json\read-json.js:160:5)
at ReadFileContext.<anonymous> (.\node_modules\read-package-json\read-json.js:332:20)
at ReadFileContext.callback (.\node_modules\graceful-fs\graceful-fs.js:90:16)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:235:13)
,一切正常。
对于处理webpack配置,我将--aot
与以下文件一起使用:
ngx-build-plus