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", "main": "main.js",
"scripts": { "scripts": {
"dev": "rollup --config rollup.config.js -w", "dev": "rollup --config rollup.config.js -w",
"build": "rollup --config rollup.config.js" "build": "rollup --config rollup.config.js --environment BUILD:production"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",

View File

@ -2,6 +2,8 @@ import typescript from '@rollup/plugin-typescript';
import {nodeResolve} from '@rollup/plugin-node-resolve'; import {nodeResolve} from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs'; import commonjs from '@rollup/plugin-commonjs';
const isProd = (process.env.BUILD === 'production');
const banner = const banner =
`/* `/*
THIS IS A GENERATED/BUNDLED FILE BY ROLLUP THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
@ -14,6 +16,7 @@ export default {
output: { output: {
dir: '.', dir: '.',
sourcemap: 'inline', sourcemap: 'inline',
sourcemapExcludeSources: isProd,
format: 'cjs', format: 'cjs',
exports: 'default', exports: 'default',
banner, banner,