Skip to content

Commit

Permalink
Merge pull request #150 from declandewet/add-unpkg-bundle
Browse files Browse the repository at this point in the history
Add unpkg bundle
  • Loading branch information
fatfisz authored May 27, 2018
2 parents f2b079c + b87b940 commit 92fbc28
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 9 deletions.
9 changes: 1 addition & 8 deletions .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@ const isEsEnv = process.env.BABEL_ENV === 'es';
module.exports = {
sourceMaps: 'inline',

presets: [
[
'env',
{
modules: isEsEnv ? false : 'commonjs',
},
],
],
presets: [['env', { modules: isEsEnv ? false : 'commonjs' }]],

plugins: [
...(isEsEnv ? [] : ['add-module-exports']),
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ logs
*.log
npm-debug.log*

dist
lib
es
.DS_Store
Expand Down
149 changes: 149 additions & 0 deletions package-lock.json

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

9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"micromatch": "3.1.10",
"prettier": "1.12.1",
"rimraf": "2.6.2",
"rollup": "0.59.3",
"rollup-plugin-babel": "3.0.4",
"rollup-plugin-node-resolve": "3.3.0",
"rollup-plugin-uglify": "4.0.0",
"when": "3.7.8"
},
"directories": {
Expand Down Expand Up @@ -72,15 +76,18 @@
"main": "lib",
"jsnext:main": "es",
"module": "es",
"unpkg": "dist/common-tags.min.js",
"files": ["dist", "es", "lib"],
"repository": {
"type": "git",
"url": "https://github.com/declandewet/common-tags"
},
"scripts": {
"clear": "rimraf lib && rimraf es",
"build": "npm run clear && npm run build:cjs && npm run build:es",
"build": "npm run clear && npm run build:cjs && npm run build:es && npm run build:unpkg",
"build:cjs": "babel src -d lib --ignore *.test.js",
"build:es": "cross-env BABEL_ENV=es babel src -d es --ignore *.test.js",
"build:unpkg": "cross-env BABEL_ENV=es rollup --config",
"codecov": "codecov",
"doctoc": "doctoc readme.md --title \"\n## Table of Contents\"",
"lint": "eslint .*rc.js src/**/*.js --ignore-pattern '!.*rc.js'",
Expand Down
15 changes: 15 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import { uglify } from 'rollup-plugin-uglify';

export default {
input: 'src/index.js',
output: {
extend: true,
file: 'dist/common-tags.min.js',
format: 'umd',
indent: false,
name: 'commonTags',
},
plugins: [babel(), resolve(), uglify()],
};

0 comments on commit 92fbc28

Please sign in to comment.