Skip to content

Commit

Permalink
refactor(general): add esm and cjs exports
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltanszogyenyi committed Jun 25, 2024
1 parent 5f781d2 commit a343785
Show file tree
Hide file tree
Showing 9 changed files with 27,169 additions and 5,580 deletions.
2,993 changes: 2,993 additions & 0 deletions dist/DateRangePicker.cjs.js

Large diffs are not rendered by default.

2,991 changes: 2,991 additions & 0 deletions dist/DateRangePicker.esm.js

Large diffs are not rendered by default.

2,775 changes: 2,775 additions & 0 deletions dist/Datepicker.cjs.js

Large diffs are not rendered by default.

2,773 changes: 2,773 additions & 0 deletions dist/Datepicker.esm.js

Large diffs are not rendered by default.

2,996 changes: 2,996 additions & 0 deletions dist/main.cjs.js

Large diffs are not rendered by default.

2,991 changes: 2,991 additions & 0 deletions dist/main.esm.js

Large diffs are not rendered by default.

15,109 changes: 9,573 additions & 5,536 deletions package-lock.json

Large diffs are not rendered by default.

34 changes: 25 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
{
"name": "flowbite-datepicker",
"version": "1.2.6",
"name": "flowbite-datepicker-1.3.0",
"version": "1.3.0",
"description": "A Tailwind CSS powered datepicker built with vanilla JavaScript and Flowbite",
"module": "js/main.js",
"main": "dist/main.cjs.js",
"module": "dist/main.esm.js",
"exports": {
".": "./js/main.js",
"./Datepicker": "./js/Datepicker.js",
"./DateRangePicker": "./js/DateRangePicker.js",
"./locales/*": "./js/i18n/locales/*.js",
"./locales/": "./js/i18n/locales/"
".": {
"require": "./dist/main.cjs.js",
"import": "./dist/main.esm.js"
},
"./Datepicker": {
"require": "./dist/Datepicker.cjs.js",
"import": "./dist/Datepicker.esm.js"
},
"./DateRangePicker": {
"require": "./dist/DateRangePicker.cjs.js",
"import": "./dist/DateRangePicker.esm.js"
},
"./locales": {
"require": "./dist/locales/index.cjs.js",
"import": "./dist/locales/index.esm.js"
}
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -36,7 +48,10 @@
"author": "Flowbite & Hidenao Miyamoto",
"license": "MIT",
"devDependencies": {
"@rollup/plugin-node-resolve": "^11.0.1",
"@babel/core": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^26.0.1",
"autoprefixer": "^10.4.0",
"bootstrap4": "npm:bootstrap@^4.5.3",
"bootstrap5": "npm:bootstrap@^5.0.1",
Expand All @@ -57,6 +72,7 @@
"unexpected": "^12.0.0"
},
"dependencies": {
"@rollup/plugin-node-resolve": "^15.2.3",

This comment has been minimized.

Copy link
@AviVahl

AviVahl Jul 1, 2024

heya @zoltanszogyenyi I think this is meant to be in "devDependencies"

"flowbite": "^2.0.0"
}
}
87 changes: 52 additions & 35 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,60 @@
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import { babel } from '@rollup/plugin-babel';

const plugins = [
resolve(),
];

module.exports = [
export default [
{
input: 'js/Datepicker.js',
output: {
file: 'dist/js/datepicker.js',
format: 'iife',
name: 'Datepicker',
},
plugins,
input: 'js/main.js',
output: [
{
file: 'dist/main.cjs.js',
format: 'cjs',
},
{
file: 'dist/main.esm.js',
format: 'es',
},
],
plugins: [
resolve(),
commonjs(),
babel({ babelHelpers: 'bundled', presets: ['@babel/preset-env'] }),
],
},
{
input: 'js/datepicker-full.js',
output: {
file: 'dist/js/datepicker-full.js',
format: 'iife',
},
plugins,
},
{
input: 'js/lib/date.js',
output: {
file: 'test/_utils/date.js',
name: 'dateUtils',
format: 'iife'
},
plugins,
input: 'js/Datepicker.js',
output: [
{
file: 'dist/Datepicker.cjs.js',
format: 'cjs',
},
{
file: 'dist/Datepicker.esm.js',
format: 'es',
},
],
plugins: [
resolve(),
commonjs(),
babel({ babelHelpers: 'bundled', presets: ['@babel/preset-env'] }),
],
},
{
input: 'js/lib/dom.js',
output: {
file: 'test/_utils/dom.js',
name: 'domUtils',
format: 'iife'
},
plugins,
},
input: 'js/DateRangePicker.js',
output: [
{
file: 'dist/DateRangePicker.cjs.js',
format: 'cjs',
},
{
file: 'dist/DateRangePicker.esm.js',
format: 'es',
},
],
plugins: [
resolve(),
commonjs(),
babel({ babelHelpers: 'bundled', presets: ['@babel/preset-env'] }),
],
}
];

0 comments on commit a343785

Please sign in to comment.