- npm install --global @angular/cli
- ng new <project-name> --create-application=false
- cd <project-name>
- ng generate library <lib-name>
- Copy provided Spectrum Spatial Analyst typings in a dir out of <project-name> dir and
- Provide path in
package.jsonfor property ‘analyst’ in devDependecies "analyst": "file:../ssa-typings", - Run npm i @angular-devkit/build-webpack @ngtools/webpack
- Copy provided
webpack.config.jsandwebpack.config.prod.jsin the <lib-name> directory - Change entry file and tsConfigPath in the
webpack.config.jsfile - Replace
@angular-devkit/build-angular:ng-packagrwith@angular-devkit/build-webpack:webpackinangular.json - In the
public-api.tsfile, export both the extension module and its corresponding component that is registered in theCustomAnalystModuleConfig.jsonfile.For example, if you have registeredMcModuleand its correspondingMcComponentinCustomAnalystModuleConfig.json, then thepublic-api.tsfile should include the following exports:export { McModule } from './lib/mc.module'; export { McComponent } from './lib/mc.component'; - Provide "webpackConfig": "projects/<lib-name>/webpack.config.js" in options of
angular.json - Provide "webpackConfig": "projects/<lib-name>/webpack.config.prod.js" in configurations > production of angular.json
- ng build <lib-name>