Skip to content

build: use rollup for better tree-shaking #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
build: add minified umd build
  • Loading branch information
pd4d10 committed Oct 29, 2020
commit 99e854de5ddff09286478d93025c5f93d5594ef5
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"rollup": "^2.29.0",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-string": "^3.0.0",
"rollup-plugin-terser": "^7.0.2",
"webpack": "^4.33.0",
"webpack-cli": "^3.3.4",
"webpack-dev-server": "^3.11.0"
Expand Down
8 changes: 8 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import babel from '@rollup/plugin-babel';
import json from '@rollup/plugin-json';
import {string} from 'rollup-plugin-string';
import globals from 'rollup-plugin-node-globals';
import {terser} from 'rollup-plugin-terser';

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

Expand All @@ -22,6 +23,13 @@ const config = {
sourcemap: true,
file: pkg.main,
},
{
format: 'umd',
name: 'spritejs',
sourcemap: true,
file: 'dist/spritejs.min.js',
plugins: [terser()],
},
],
plugins: [
babel({
Expand Down