diff --git a/package.json b/package.json index d3346cb4..06e20921 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/rollup.config.ts b/rollup.config.ts index 5aa204c0..a39ef8bd 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -61,13 +61,22 @@ 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), @@ -75,7 +84,7 @@ export default [ ), createBundle( { - file: path.join(__dirname, 'dist/caroucssel.min.js'), + file: path.join(__dirname, 'dist/formats/umd/caroucssel.min.js'), }, [ babel(PLUGIN_SETTINGS_BABEL),