Skip to content

Commit

Permalink
fix last warnings in yarn build for rollup.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
timhagn committed Oct 23, 2018
1 parent e534fa1 commit ddf96fc
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,32 @@ let config = {
exports: 'named'
},
external: ['react', 'styled-components'],
}
};

let plugins = [
resolve(),
commonjs(),
babel(),
];

const globals = {
'styled-components': 'styledComponents',
react: 'React',
'react-dom': 'ReactDOM',
};

if (prod) plugins.push(uglify());

if (process.env.BROWSER) {
config = Object.assign(config, {
dest: 'dist/styled-media-query.umd.js',
format: 'umd',
moduleName: 'styled-media-query',
sourceMap: true,
exports: 'named',
output: {
file: 'dist/styled-media-query.umd.js',
format: 'umd',
name: 'styled-media-query',
sourcemap: true,
exports: 'named',
globals,
},
plugins,
})

Expand All @@ -39,8 +48,11 @@ if (process.env.BROWSER) {
commonjs(),
babel(),
],
dest: 'dist/styled-media-query.common.js',
format: 'cjs',
output: {
file: 'dist/styled-media-query.common.js',
format: 'cjs',
exports: 'named',
}
})

} else if (process.env.ES) {
Expand All @@ -50,8 +62,10 @@ if (process.env.BROWSER) {
commonjs(),
babel(),
],
dest: 'dist/styled-media-query.es.js',
format: 'es',
output: {
file: 'dist/styled-media-query.es.js',
format: 'es',
},
})
}

Expand Down

0 comments on commit ddf96fc

Please sign in to comment.