Skip to content
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

Add unpkg bundle #150

Merged
merged 2 commits into from
May 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
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()],
};