Skip to content

Commit

Permalink
Moved .map files behind dev flag (#855)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Marszalek authored Nov 10, 2020
1 parent 9c5390a commit 4ab03c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 3 additions & 4 deletions libraries/core-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"publishConfig": {
"main": "dist/core-react.cjs.js",
"module": "dist/core-react.es.js",
"browser": "dist/core-react.umd.js",
"types": "dist/types/index.d.ts"
"browser": "dist/core-react.umd.js"
},
"types": "dist/types/index.d.ts",
"license": "AGPL-3.0-or-later",
"author": {
"name": "EDS Core Team",
Expand All @@ -29,8 +29,7 @@
"scripts": {
"prepare": "npm run build",
"build": "rollup -c",
"build:for-storybook": "rollup -c",
"dev": "rollup -c -w",
"dev": "rollup -c -w NODE_ENV=development",
"test": "jest",
"test:watch": "jest --watch"
},
Expand Down
8 changes: 5 additions & 3 deletions libraries/core-react/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import typescript from 'rollup-plugin-typescript2'
import pkg from './package.json'

const peerDeps = Object.keys(pkg.peerDependencies || {})
const environment = process.env.NODE_ENV

const isDevelopment = environment === 'development'

const globals = {
react: 'React',
Expand All @@ -21,7 +24,6 @@ export default [
{
input: './src/index.ts',
external: peerDeps,
// : [...peerDeps, 'focus-visible'],
watch: {
clearScreen: true,
include: ['./src/**', './../tokens/**'],
Expand All @@ -48,8 +50,8 @@ export default [
{
file: pkg.publishConfig.module,
name: pkg.name,
format: 'esm',
sourcemap: true,
format: 'es',
sourcemap: isDevelopment,
globals,
},
{ file: pkg.publishConfig.main, format: 'cjs' },
Expand Down

0 comments on commit 4ab03c9

Please sign in to comment.