Skip to content

Commit f1d3d4c

Browse files
author
Jorge Rodríguez Galán
committed
fix(rollup): fix bundle using commonjs
1 parent d20b20d commit f1d3d4c

File tree

11 files changed

+76
-69
lines changed

11 files changed

+76
-69
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ This library is compatible with AoT compilation & Server Side Rendering. It also
7575
It would be awesome if you would like to contribute code or help with bugs. Just follow the guidelines [CONTRIBUTING](https://github.com/mallorcajs/mallorca-ng/blob/master/CONTRIBUTING.md).
7676
7777
## Aditional Resources
78-
- [Library starter by Roberto Simonetti](https://github.com/robisim74/angular-library-starter) Allows you to create a library for Angular 4+ apps
78+
- [Library starter by Roberto Simonetti](https://github.com/robisim74/angular-library-starter) Allows you to create a library for Angular 5+ apps
7979
8080
## License
8181
MIT

build.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const ESM5_DIR = `${NPM_DIR}/esm5`;
1010
const BUNDLES_DIR = `${NPM_DIR}/bundles`;
1111
const OUT_DIR_ESM5 = `${NPM_DIR}/package/esm5`;
1212

13-
1413
shell.echo(`Start building...`);
1514

1615
shell.rm(`-Rf`, `${NPM_DIR}/*`);

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,11 @@
120120
"prettier": "^1.8.1",
121121
"reflect-metadata": "0.1.10",
122122
"rimraf": "^2.6.2",
123-
"rollup": "0.51.1",
123+
"rollup": "0.50.0",
124+
"rollup-plugin-commonjs": "8.2.6",
125+
"rollup-plugin-license": "0.5.0",
124126
"rollup-plugin-node-resolve": "3.0.0",
127+
"rollup-plugin-sourcemaps": "0.4.2",
125128
"rxjs": "5.5.2",
126129
"semantic-release": "8.2.0",
127130
"shelljs": "0.7.8",

rollup.config.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import resolve from "rollup-plugin-node-resolve";
22
import sourcemaps from 'rollup-plugin-sourcemaps';
3-
3+
import commonjs from 'rollup-plugin-commonjs';
44
/**
55
* Add here external dependencies that actually you use.
66
*
@@ -25,11 +25,16 @@ const globals = {
2525
};
2626

2727
export default {
28-
plugins: [resolve(), sourcemaps()],
28+
plugins: [
29+
commonjs({
30+
include: 'node_modules/**'
31+
}),
32+
resolve(),
33+
sourcemaps()],
2934
onwarn: () => { return; },
3035
output: {
3136
format: "umd",
32-
name: "ng.angularLibraryStarter",
37+
name: "ng.mallorcaNG",
3338
globals: globals,
3439
sourcemap: true,
3540
exports: "named"

src/core/common/common.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
MTrimPipe,
1212
MTimeAgoPipe,
1313
MTimeDifferencePipe
14-
} from './pipes';
14+
} from './pipes/index';
1515

1616
const M_PIPES: Array<Type<any>> = [
1717
MCapitalizePipe,

src/core/common/pipes/string/capitalize/capitalize.pipe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Pipe, PipeTransform } from '@angular/core';
2-
import { isString, upperFirst } from '../../../utils';
2+
import { isString, upperFirst } from '../../../utils/index';
33
@Pipe({
44
name: 'capitalize'
55
})

src/core/common/pipes/string/reverse-str/reverse-str.pipe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Pipe, PipeTransform } from '@angular/core';
2-
import { isString } from '../../../utils';
2+
import { isString } from '../../../utils/index';
33
@Pipe({
44
name: 'reverseStr'
55
})

src/core/common/pipes/string/trim/trim.pipe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Pipe, PipeTransform } from '@angular/core';
2-
import { isString } from '../../../utils';
2+
import { isString } from '../../../utils/index';
33
@Pipe({
44
name: 'trim'
55
})

src/mallorca-ng.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { MallorcaCommonModule } from './core';
1+
export { MallorcaCommonModule } from './core/index';

tsconfig-build.json

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
{
2-
"compilerOptions": {
3-
"rootDir": ".",
4-
"baseUrl": ".",
5-
"paths": {
2+
"compilerOptions": {
3+
"rootDir": ".",
4+
"baseUrl": ".",
5+
"paths": {
66
"@angular/*": [
7-
"node_modules/@angular/*"
7+
"node_modules/@angular/*"
88
]
9-
},
10-
"outDir": "dist",
11-
"declaration": true,
12-
"strict": true,
13-
"moduleResolution": "node",
14-
"module": "es2015",
15-
"target": "es2015",
16-
"lib": [
17-
"es2015",
18-
"dom"
19-
],
20-
"skipLibCheck": true,
21-
"types": [],
22-
"experimentalDecorators": true,
23-
"emitDecoratorMetadata": true,
24-
"sourceMap": true,
25-
"inlineSources": true
26-
},
27-
"files": [
28-
"public_api.ts",
29-
"node_modules/zone.js/dist/zone.js.d.ts"
30-
],
31-
"angularCompilerOptions": {
32-
"skipTemplateCodegen": true,
33-
"annotateForClosureCompiler": true,
34-
"strictMetadataEmit": true,
35-
"flatModuleOutFile": "mallorca-ng.js",
36-
"flatModuleId": "mallorca-ng"
37-
}
9+
},
10+
"outDir": "dist",
11+
"declaration": true,
12+
"strict": true,
13+
"moduleResolution": "node",
14+
"module": "es2015",
15+
"target": "es2015",
16+
"lib": [
17+
"es2015",
18+
"dom"
19+
],
20+
"skipLibCheck": true,
21+
"types": [],
22+
"experimentalDecorators": true,
23+
"emitDecoratorMetadata": true,
24+
"sourceMap": true,
25+
"inlineSources": true
26+
},
27+
"files": [
28+
"public_api.ts",
29+
"node_modules/zone.js/dist/zone.js.d.ts"
30+
],
31+
"angularCompilerOptions": {
32+
"skipTemplateCodegen": true,
33+
"annotateForClosureCompiler": true,
34+
"strictMetadataEmit": true,
35+
"flatModuleOutFile": "mallorca-ng.js",
36+
"flatModuleId": "mallorca-ng"
37+
}
3838
}

tsconfig.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
2-
"compilerOptions": {
3-
"baseUrl": ".",
4-
"emitDecoratorMetadata": true,
5-
"experimentalDecorators": true,
6-
"strict": true,
7-
"module": "commonjs",
8-
"moduleResolution": "node",
9-
"rootDir": ".",
10-
"sourceMap": true,
11-
"inlineSources": true,
12-
"target": "es5",
13-
"skipLibCheck": true,
14-
"lib": [
15-
"es2015",
16-
"dom"
17-
],
18-
"typeRoots": [
19-
"./node_modules/@types/"
20-
]
21-
},
22-
"exclude": [
23-
"node_modules"
24-
]
25-
}
2+
"compilerOptions": {
3+
"baseUrl": ".",
4+
"emitDecoratorMetadata": true,
5+
"experimentalDecorators": true,
6+
"strict": true,
7+
"module": "commonjs",
8+
"moduleResolution": "node",
9+
"rootDir": ".",
10+
"sourceMap": true,
11+
"inlineSources": true,
12+
"target": "es5",
13+
"skipLibCheck": true,
14+
"lib": [
15+
"es2015",
16+
"dom"
17+
],
18+
"typeRoots": [
19+
"./node_modules/@types/"
20+
]
21+
},
22+
"exclude": [
23+
"node_modules"
24+
]
25+
}

0 commit comments

Comments
 (0)