Skip to content

Commit

Permalink
chore: bundle commonjs
Browse files Browse the repository at this point in the history
  • Loading branch information
pearmini committed Jun 29, 2021
1 parent f8a7858 commit f808dc5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^12.0.1",
"@rollup/plugin-commonjs": "^19.0.0",
"@types/benchmark": "^2.1.0",
"@types/color-string": "^1.5.0",
"@types/jest": "^26.0.20",
Expand Down Expand Up @@ -83,12 +84,12 @@
"limit-size": [
{
"path": "dist/scale.min.js",
"limit": "8 Kb",
"limit": "10 Kb",
"gzip": true
},
{
"path": "dist/scale.min.js",
"limit": "24 Kb"
"limit": "30 Kb"
}
],
"author": {
Expand Down
25 changes: 12 additions & 13 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import commonjs from '@rollup/plugin-commonjs';
import { uglify } from 'rollup-plugin-uglify';
import resolve from 'rollup-plugin-node-resolve';
import typescript from 'rollup-plugin-typescript';

module.exports = [{
input: 'src/index.ts',
output: {
file: 'dist/scale.min.js',
name: 'Scale',
format: 'umd',
sourcemap: false,
module.exports = [
{
input: 'src/index.ts',
output: {
file: 'dist/scale.min.js',
name: 'Scale',
format: 'umd',
sourcemap: false,
},
plugins: [resolve(), typescript(), commonjs(), uglify()],
},
plugins: [
resolve(),
typescript(),
uglify(),
],
}];
];
2 changes: 1 addition & 1 deletion src/utils/color.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const colorString = require('color-string');
import colorString from 'color-string';

function hue2rgb(p: number, q: number, m: number) {
let t = m;
Expand Down

0 comments on commit f808dc5

Please sign in to comment.