I have a skeleton application build with mgechev/angular-seed
and 2muchcoffeecom/ngx-restangular
. I would like to integrate them but I cannot find out the solution how to do it.
Before I successfully add few packages to project.config.ts
simply following angular-seed
documentation.
Here is a piece of configuration that works fine:
...
# tools/config/project.config.ts
let additionalPackages: ExtendPackages[];
additionalPackages = [ {
name: 'angular2-jwt',
path: 'node_modules/angular2-jwt',
packageMeta: {
defaultExtension: 'js',
}
}, {
name: 'ngx-progressbar',
path: 'node_modules/ngx-progressbar/bundles/ngx-progressbar.umd.js',
}, {
name: 'ng2-charts',
path: 'node_modules/ng2-charts/bundles/ng2-charts.umd.min.js'
}, {
name:'ngx-bootstrap',
path:'node_modules/ngx-bootstrap/bundles/ngx-bootstrap.umd.min.js'
}, {
name:'ngx-bootstrap/*',
path:'node_modules/ngx-bootstrap/bundles/ngx-bootstrap.umd.min.js'
}, {
name:'ng2-select-compat',
path:'node_modules/ng2-select-compat/bundles/ng2-select-compat.umd.min.js'
}, {
name:'ngx-avatar',
path:'node_modules/ngx-avatar/ngx-avatar.umd.js'
}];
...
But when I'm trying to add ngx-restangular
:
...
# tools/config/project.config.ts
const additionalPackages: ExtendPackages[] = [
{
name: 'ngx-restangular',
path: 'node_modules/ngx-restangular/dist/esm/src/',
packageMeta: {
defaultExtension: 'js',
main: './index.js',
}
}];
...
Application throws an error:
(index):60 SyntaxError: Unexpected token < at eval (<anonymous>)
In the browser network tab I can see that ngx-restangular
files are loading:
- index.js
- ngx-restangular.module.js
- ngx-restangular.js
- ngx-restangular-http.js
- ngx-restangular.config.js
- ngx-restangular-config.factory.js
- ngx-restangular-helper.js
Link to Github repository. To run it in your local env, please simply clone/fork and npm install && npm start
Link configuration file project.config.ts