diff --git a/libraries/core-react/package.json b/libraries/core-react/package.json index e516c55751..bce24302fb 100644 --- a/libraries/core-react/package.json +++ b/libraries/core-react/package.json @@ -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", @@ -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" }, diff --git a/libraries/core-react/rollup.config.js b/libraries/core-react/rollup.config.js index d3758d44cd..9ab72e4a6a 100644 --- a/libraries/core-react/rollup.config.js +++ b/libraries/core-react/rollup.config.js @@ -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', @@ -21,7 +24,6 @@ export default [ { input: './src/index.ts', external: peerDeps, - // : [...peerDeps, 'focus-visible'], watch: { clearScreen: true, include: ['./src/**', './../tokens/**'], @@ -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' },