@@ -2,7 +2,7 @@ import fs from 'fs';
2
2
import path from 'path' ;
3
3
import babel from 'rollup-plugin-babel' ;
4
4
import json from 'rollup-plugin-json' ;
5
- import { uglify } from 'rollup-plugin-uglify' ;
5
+ // import { uglify } from 'rollup-plugin-uglify';
6
6
7
7
// reads package.json of packages (melody-*) in packages directory
8
8
const pkg = fs . readFileSync ( path . join ( process . cwd ( ) , './package.json' ) ) ;
@@ -15,7 +15,7 @@ const config = {
15
15
output : [
16
16
{
17
17
file : path . resolve ( process . cwd ( ) , pkgJSON . main ) ,
18
- format : 'cjs ' ,
18
+ format : 'es ' ,
19
19
} ,
20
20
] ,
21
21
plugins : [
@@ -31,29 +31,29 @@ const config = {
31
31
] ,
32
32
} ;
33
33
34
- /**
35
- * ES module output configuration
36
- */
37
- const esmModuleOutput = function ( ) {
38
- return {
39
- file : path . resolve ( process . cwd ( ) , pkgJSON [ 'jsnext:main' ] ) ,
40
- format : 'es' ,
41
- } ;
42
- } ;
34
+ // / **
35
+ // * ES module output configuration
36
+ // */
37
+ // const esmModuleOutput = function() {
38
+ // return {
39
+ // file: path.resolve(process.cwd(), pkgJSON['jsnext:main']),
40
+ // format: 'es',
41
+ // };
42
+ // };
43
43
44
- // Let's skip ES Modules in production environment
45
- if ( pkgJSON [ 'jsnext:main' ] && process . env . NODE_ENV !== 'production' ) {
46
- config . output . push ( esmModuleOutput ( ) ) ;
47
- }
44
+ // // Let's skip ES Modules in production environment
45
+ // if (pkgJSON['jsnext:main'] && process.env.NODE_ENV !== 'production') {
46
+ // config.output.push(esmModuleOutput());
47
+ // }
48
48
49
- if ( process . env . NODE_ENV === 'production' ) {
50
- config . plugins . push (
51
- uglify ( {
52
- mangle : {
53
- toplevel : true ,
54
- } ,
55
- } )
56
- ) ;
57
- }
49
+ // if (process.env.NODE_ENV === 'production') {
50
+ // config.plugins.push(
51
+ // uglify({
52
+ // mangle: {
53
+ // toplevel: true,
54
+ // },
55
+ // })
56
+ // );
57
+ // }
58
58
59
59
export default config ;
0 commit comments