Skip to content

Commit

Permalink
feat: add rollup and esm, remove toCase
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxiangmoe committed Jun 20, 2020
1 parent 7f054b0 commit 4d68b05
Show file tree
Hide file tree
Showing 9 changed files with 374 additions and 225 deletions.
148 changes: 148 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
"case.d.ts"
],
"main": "dist/Case.js",
"module": "dist/Case.mjs",
"exports": {
".": {
"import": "./dist/Case.mjs",
"require": "./dist/Case.js",
"default": "./dist/Case.js"
}
},
"bugs": {
"url": "http://github.com/nbubna/Case/issues",
"email": "[email protected]"
Expand All @@ -40,6 +48,7 @@
},
"license": "(MIT OR GPL-3.0-or-later)",
"scripts": {
"build": "rollup --config ./rollup.config.js",
"test": "grunt qunit"
},
"devDependencies": {
Expand All @@ -52,7 +61,9 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-contrib-uglify": "^4.0.1",
"grunt-contrib-watch": "^1.1.0",
"grunt-nuget": "~0.3.1"
"grunt-nuget": "~0.3.1",
"rollup": "^2.17.1",
"rollup-plugin-terser": "^6.1.0"
},
"typings": "case.d.ts"
}
42 changes: 42 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// @ts-check

import { terser } from 'rollup-plugin-terser';

/**
* @type { import('rollup').RollupOptions }
*/
const config = {
input: './src/Case.mjs',
output: [
{
file: './dist/Case.js',
format: 'umd',
name: 'Case',
sourcemap: true,
sourcemapExcludeSources: true,
},
{
file: './dist/Case.mjs',
format: 'esm',
sourcemap: true,
sourcemapExcludeSources: true,
},
{
file: './dist/Case.min.js',
format: 'umd',
name: 'Case',
sourcemap: true,
sourcemapExcludeSources: true,
plugins: [terser()],
},
{
file: './dist/Case.min.mjs',
format: 'esm',
sourcemap: true,
sourcemapExcludeSources: true,
plugins: [terser()],
},
],
};

export default config;
Loading

0 comments on commit 4d68b05

Please sign in to comment.