Skip to content

Commit

Permalink
fix(configs): build cjs and es on dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
deini committed Oct 18, 2019
1 parent 59cbfe3 commit 498606f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/configs/rollup/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const sourceMaps = require('rollup-plugin-sourcemaps');
const typescript = require('rollup-plugin-typescript2');

const nodeEnv = process.env.NODE_ENV || 'production';
const isDev = nodeEnv === 'dev';

function generateConfig(pkg) {
const externals = [
Expand All @@ -20,7 +19,7 @@ function generateConfig(pkg) {
return {
input: 'src/index.ts',
output: [
!isDev && { file: pkg.main, format: 'cjs', sourcemap: true },
{ file: pkg.main, format: 'cjs', sourcemap: true },
{ file: pkg.module, format: 'es', sourcemap: true }
].filter(Boolean),
external: makeExternalPredicate(externals),
Expand Down

0 comments on commit 498606f

Please sign in to comment.