Skip to content

Commit

Permalink
fix: add JS distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
calimanco committed Jan 20, 2021
1 parent 9e50add commit 74389b7
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 2 deletions.
42 changes: 40 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"rollup": "^2.37.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"rollup-plugin-typescript2": "^0.29.0",
"rollup-plugin-uglify": "^6.0.4",
"semantic-release": "^17.3.4",
"shelljs": "^0.8.3",
"ts-jest": "^26.4.4",
Expand Down
22 changes: 22 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/npm',
[
'@semantic-release/github',
{
assets: [
{
path: 'dist/promise-polyfill-plus.umd.js',
label: 'JS umd'
},
{
path: 'dist/promise-polyfill-plus.umd.min.js',
label: 'JS umd min'
}
]
}
]
]
}
9 changes: 9 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import json from '@rollup/plugin-json'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import sourceMaps from 'rollup-plugin-sourcemaps'
import { uglify } from 'rollup-plugin-uglify'
import { camelCase } from 'lodash'
import typescript from 'rollup-plugin-typescript2'
import pkg from './package.json'
Expand All @@ -17,6 +18,14 @@ export default {
format: 'umd',
sourcemap: true
},
{
file: pkg.main.replace('.js', '.min.js'),
name: camelCase(libraryName),
format: 'umd',
sourcemap: false,
outro: 'autoPolyfill()',
plugins: [uglify()]
},
{ file: pkg.module, format: 'es', sourcemap: true }
],
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
Expand Down

0 comments on commit 74389b7

Please sign in to comment.