forked from mymth/vanillajs-datepicker
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(general): add esm and cjs exports
- Loading branch information
1 parent
5f781d2
commit a343785
Showing
9 changed files
with
27,169 additions
and
5,580 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] }), | ||
], | ||
} | ||
]; |
heya @zoltanszogyenyi I think this is meant to be in "devDependencies"