Skip to content

Commit

Permalink
Bundle formats in separate directories
Browse files Browse the repository at this point in the history
  • Loading branch information
Norman Rusch committed Sep 21, 2021
1 parent bda5791 commit a9d60e8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.12.0-0",
"description": "A lightweight dependency-free css carousel.",
"module": "dist/index.js",
"main": "dist/caroucssel.cjs.js",
"unpkg": "dist/caroucssel.min.js",
"main": "dist/formats/cjs/caroucssel.js",
"unpkg": "dist/formats/umd/caroucssel.min.js",
"types": "dist/caroucssel.d.ts",
"sideEffects": false,
"scripts": {
Expand Down
15 changes: 12 additions & 3 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,30 @@ function createBundle(output: rollup.OutputOptions = {}, plugins: rollup.Plugin[
export default [
createBundle(
{
file: path.join(__dirname, 'dist/caroucssel.cjs.js'),
file: path.join(__dirname, 'dist/formats/cjs/caroucssel.js'),
format: 'cjs',
},
),
createBundle(
{
file: path.join(__dirname, 'dist/caroucssel.umd.js'),
file: path.join(__dirname, 'dist/formats/cjs/caroucssel.min.js'),
format: 'cjs',
},
[
terser(PLUGIN_SETTINGS_TERSER),
],
),
createBundle(
{
file: path.join(__dirname, 'dist/formats/umd/caroucssel.js'),
},
[
babel(PLUGIN_SETTINGS_BABEL),
]
),
createBundle(
{
file: path.join(__dirname, 'dist/caroucssel.min.js'),
file: path.join(__dirname, 'dist/formats/umd/caroucssel.min.js'),
},
[
babel(PLUGIN_SETTINGS_BABEL),
Expand Down

0 comments on commit a9d60e8

Please sign in to comment.