Skip to content

Commit

Permalink
build: add minified bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
tomi committed Nov 3, 2019
1 parent a73435d commit 44d79a3
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 0 deletions.
97 changes: 97 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^4.0.1",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^5.1.2",
"rollup-plugin-typescript2": "^0.19.3",
"semantic-release": "^15.9.16",
"style-loader": "^0.23.1",
Expand Down
12 changes: 12 additions & 0 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import sourceMaps from "rollup-plugin-sourcemaps";
import camelCase from "lodash.camelcase";
import typescript from "rollup-plugin-typescript2";
import json from "rollup-plugin-json";
import { terser } from "rollup-plugin-terser";

const pkg = require("./package.json");

Expand All @@ -18,7 +19,14 @@ export default {
format: "umd",
sourcemap: true,
},
{
file: "dist/fromfrom.umd.min.js",
name: "fromfrom",
format: "umd",
sourcemap: true,
},
{ file: pkg.module, format: "es", sourcemap: true },
{ file: "dist/fromfrom.es5.min.js", format: "es", sourcemap: true },
],
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
external: [],
Expand All @@ -37,6 +45,10 @@ export default {
// https://github.com/rollup/rollup-plugin-node-resolve#usage
resolve(),

terser({
include: [/^.+\.min\.js$/],
}),

// Resolve source maps to the original source
sourceMaps(),
],
Expand Down

0 comments on commit 44d79a3

Please sign in to comment.