Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit eab0580

Browse files
author
yanxuekai
committed
fix ng2-bootstrap import error:Module must be loaded as AMD or CommonJS
1 parent d08f894 commit eab0580

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

‎frontend/tools/config/project.config.ts‎

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { join } from 'path';
22

33
import { SeedConfig } from './seed.config';
4-
// import { ExtendPackages } from './seed.config.interfaces';
4+
import { ExtendPackages } from './seed.config.interfaces';
55

66
/**
77
* This class extends the basic seed configuration, allowing for project specific overrides. A few examples can be found
@@ -21,8 +21,8 @@ export class ProjectConfig extends SeedConfig {
2121

2222
// Add `NPM` third-party libraries to be injected/bundled.
2323
this.NPM_DEPENDENCIES = [
24-
...this.NPM_DEPENDENCIES,
25-
{src: 'ng2-bootstrap/bundles/ng2-bootstrap.umd.min.js', inject: 'libs'}
24+
...this.NPM_DEPENDENCIES
25+
//{src: 'ng2-bootstrap/bundles/ng2-bootstrap.umd.min.js', inject: 'libs'}
2626
// {src: 'jquery/dist/jquery.min.js', inject: 'libs'},
2727
// {src: 'lodash/lodash.min.js', inject: 'libs'},
2828
];
@@ -47,18 +47,22 @@ export class ProjectConfig extends SeedConfig {
4747
//
4848
// or
4949
//
50-
// let additionalPackages: ExtendPackages[] = [];
51-
//
52-
// additionalPackages.push({
53-
// name: 'lodash',
54-
// path: `${this.APP_BASE}node_modules/lodash/lodash.js`,
55-
// packageMeta: {
56-
// main: 'index.js',
57-
// defaultExtension: 'js'
58-
// }
59-
// });
60-
//
61-
// this.addPackagesBundles(additionalPackages);
50+
let additionalPackages: ExtendPackages[] = [
51+
// required for dev build
52+
{
53+
name:'ng2-bootstrap',
54+
path:'node_modules/ng2-bootstrap/bundles/ng2-bootstrap.umd.min.js'
55+
},
56+
57+
// required for prod build
58+
{
59+
name:'ng2-bootstrap/*',
60+
path:'node_modules/ng2-bootstrap/bundles/ng2-bootstrap.umd.min.js'
61+
}
62+
];
63+
64+
65+
this.addPackagesBundles(additionalPackages);
6266

6367
/* Add to or override NPM module configurations: */
6468
// this.mergeObject(this.PLUGIN_CONFIGS['browser-sync'], { ghostMode: false });

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /