From e1efb17322a5bdc194b547cdca3c4711952917ca Mon Sep 17 00:00:00 2001 From: lishid Date: Tue, 6 Apr 2021 08:47:51 -0400 Subject: [PATCH] Rollup: Don't include source code in distribution. --- package.json | 2 +- rollup.config.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c0573df..e64cbd1 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "main.js", "scripts": { "dev": "rollup --config rollup.config.js -w", - "build": "rollup --config rollup.config.js" + "build": "rollup --config rollup.config.js --environment BUILD:production" }, "keywords": [], "author": "", diff --git a/rollup.config.js b/rollup.config.js index 96cff59..dd4d041 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -2,6 +2,8 @@ import typescript from '@rollup/plugin-typescript'; import {nodeResolve} from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; +const isProd = (process.env.BUILD === 'production'); + const banner = `/* THIS IS A GENERATED/BUNDLED FILE BY ROLLUP @@ -14,6 +16,7 @@ export default { output: { dir: '.', sourcemap: 'inline', + sourcemapExcludeSources: isProd, format: 'cjs', exports: 'default', banner,