diff --git a/package.json b/package.json index 5220ca4a95..e3b4287290 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,9 @@ "name": "@bitwarden/jslib", "version": "0.0.11", "description": "Common code used across bitwarden JavaScript projects.", - "keywords": [ "bitwarden" ], + "keywords": [ + "bitwarden" + ], "main": "dist/index.umd.js", "module": "dist/index.es5.js", "typings": "dist/types/index.d.ts", @@ -15,7 +17,7 @@ }, "scripts": { "lint": "tslint 'src/**/*.ts'", - "prebuild": "rimraf dist", + "prebuild": "rimraf dist/**/*", "build": "tsc && tsc --module commonjs --outDir dist/lib && rollup -c rollup.config.ts && typedoc --out dist/docs --target es6 --theme minimal --mode file src", "start": "concurrently \"tsc -w\" \"rollup -c rollup.config.ts -w\"" }, diff --git a/rollup.config.ts b/rollup.config.ts index dfe12895ed..32b87a0af2 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -5,30 +5,30 @@ import resolve from 'rollup-plugin-node-resolve'; import sourceMaps from 'rollup-plugin-sourcemaps'; const pkg = require('./package.json'); - const libraryName = 'index'; export default { - input: `dist/es/${libraryName}.js`, - output: [ - { file: pkg.main, name: libraryName, format: 'umd' }, - { file: pkg.module, format: 'es' }, - ], - sourcemap: true, - // Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash') - external: [], - watch: { - include: 'dist/es/**', - }, - plugins: [ - // Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs) - commonjs(), - // Allow node_modules resolution, so you can use 'external' to control - // which external modules to include in the bundle - // https://github.com/rollup/rollup-plugin-node-resolve#usage - resolve(), + input: `dist/es/${libraryName}.js`, + output: [ + { file: pkg.main, name: libraryName, format: 'umd' }, + { file: pkg.module, format: 'es' }, + ], + sourcemap: true, + // Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash') + external: [], + watch: { + include: 'dist/es/**', + }, + plugins: [ + // Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs) + commonjs(), - // Resolve source maps to the original source - sourceMaps(), - ], + // Allow node_modules resolution, so you can use 'external' to control + // which external modules to include in the bundle + // https://github.com/rollup/rollup-plugin-node-resolve#usage + resolve(), + + // Resolve source maps to the original source + sourceMaps(), + ], };