Rollup: Don't include source code in distribution.

This commit is contained in:
lishid 2021-04-06 08:47:51 -04:00
parent 123b00ca52
commit e1efb17322
2 changed files with 4 additions and 1 deletions

View File

@ -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": "",

View File

@ -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,