forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
42 lines (35 loc) · 1.07 KB
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// import typescript from 'rollup-plugin-typescript';
// import tsc from 'typescript'
import nodeResolve from 'rollup-plugin-node-resolve';
class RollupNG2 {
constructor(options){
this.options = options;
}
resolveId(id, from){
//console.log(id, from);
// if(id.startsWith('angular2/')){
// return `${__dirname}/vendor/angular2/${id.split('angular2/').pop()}.js`;
// }
if(id.startsWith('rxjs/')){
return `${__dirname}/node_modules/rxjs-es/${id.replace('rxjs/', '')}.js`;
}
}
}
const rollupNG2 = (config) => new RollupNG2(config);
export default {
entry: 'dist/hello_world.js',
//entry: 'hello_world.ts',
sourceMap: true,
plugins: [
//typescript({typescript: tsc, target: 'es5', declaration: false}),
rollupNG2(),
nodeResolve({ jsnext: true, main: true }),
]
}