Skip to content

Commit

Permalink
chore(build): add minified files build
Browse files Browse the repository at this point in the history
  • Loading branch information
ismail9k committed Nov 6, 2024
1 parent f40e7aa commit 2a1ab06
Show file tree
Hide file tree
Showing 3 changed files with 653 additions and 654 deletions.
15 changes: 12 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue3-carousel",
"version": "0.4.0",
"version": "0.5.0",
"type": "module",
"scripts": {
"build": "rollup -c",
Expand All @@ -24,12 +24,18 @@
".": {
"types": "./dist/carousel.d.ts",
"import": "./dist/carousel.es.js",
"require": "./dist/carousel.js"
"require": "./dist/carousel.js",
"browser": "./dist/carousel.min.js"
},
"./dist/carousel": {
"types": "./dist/carousel.d.ts",
"import": "./dist/carousel.es.js",
"require": "./dist/carousel.js"
"require": "./dist/carousel.js",
"browser": "./dist/carousel.min.js"
},
"./dist/carousel.min.js": {
"import": "./dist/carousel.es.min.js",
"require": "./dist/carousel.min.js"
},
"./dist/*.css": {
"import": "./dist/*.css",
Expand All @@ -40,7 +46,10 @@
"module": "dist/carousel.es.js",
"style": "dist/carousel.css",
"types": "dist/carousel.d.ts",
"unpkg": "dist/carousel.min.js",
"jsdelivr": "dist/carousel.min.js",
"devDependencies": {
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.1",
"@stackblitz/sdk": "^1.11.0",
"@typescript-eslint/eslint-plugin": "^5.38.1",
Expand Down
21 changes: 21 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import del from 'rollup-plugin-delete'
import dts from 'rollup-plugin-dts'
import { typescriptPaths } from 'rollup-plugin-typescript-paths'
import typescript from '@rollup/plugin-typescript'
import terser from '@rollup/plugin-terser'

import pkg from './package.json' assert { type: 'json' }

Expand All @@ -16,6 +17,7 @@ export default [
{
input: 'src/index.ts',
output: [
// UMD output
{
file: pkg.main,
format: 'umd',
Expand All @@ -25,11 +27,30 @@ export default [
vue: 'Vue',
},
},
// ES output
{
file: pkg.module,
format: 'es',
banner,
},
// Minified UMD output
{
file: 'dist/carousel.min.js',
format: 'umd',
name: 'VueCarousel',
banner,
globals: {
vue: 'Vue',
},
plugins: [terser()],
},
// Minified ES output
{
file: 'dist/carousel.es.min.js',
format: 'es',
banner,
plugins: [terser()],
},
],
external: [
...Object.keys(pkg.dependencies || {}),
Expand Down
Loading

0 comments on commit 2a1ab06

Please sign in to comment.