SharePoint FX与Angular的集成情况如何?我知道它对React有很好的支持,但是我想知道使用Angular 6+的SharePoint框架的优缺点
发布于 2019-08-28 15:21:03
让我们为Angular更新一些文件,以便与SharePoint框架一起工作。
package.json
"@angular/common": "^6.0.3",
"@angular/compiler": "^6.0.3",
"@angular/core": "^6.0.3",
"@angular/elements": "^6.0.3",
"@angular/platform-browser": "^6.0.3",
"@angular/platform-browser-dynamic": "^6.0.3",
"@webcomponents/custom-elements": "^1.1.1",
"core-js": "^2.5.7",
"rxjs": "^6.2.0",
"zone.js": "^0.8.26"tsconfig.json
这是集成开发环境的TypeScript配置文件。打开"compilerOptions".下面的行,打开tsconfig.json文件
"emitDecoratorMetadata": true,gulpfile.js
这个文件定义了项目的所有任务,比如将TypeScript文件编译成JavaScript,打包和压缩JS/CSS文件等。我们需要修改构建过程。打开"gulpfile.js“文件,在"build.initialize”行的上方添加下面的代码。
const webpack = require('webpack');
const path = require('path');
build.configureWebpack.mergeConfig({
additionalConfiguration: (generatedConfiguration) => {
generatedConfiguration.plugins.push(new webpack.ContextReplacementPlugin(/\@angular(\\|\/)core(\\|\/)fesm5/, path.join(__dirname, './client')));
return generatedConfiguration;
}
});下面是关于在SharePoint框架中使用Angular 6源代码的两种解决方案,供您参考。
https://stackoverflow.com/questions/57681242
复制相似问题