Skip to content

Commit 92fbc28

Browse files
authored
Merge pull request #150 from declandewet/add-unpkg-bundle
Add unpkg bundle
2 parents f2b079c + b87b940 commit 92fbc28

File tree

5 files changed

+174
-9
lines changed

5 files changed

+174
-9
lines changed

.babelrc.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@ const isEsEnv = process.env.BABEL_ENV === 'es';
33
module.exports = {
44
sourceMaps: 'inline',
55

6-
presets: [
7-
[
8-
'env',
9-
{
10-
modules: isEsEnv ? false : 'commonjs',
11-
},
12-
],
13-
],
6+
presets: [['env', { modules: isEsEnv ? false : 'commonjs' }]],
147

158
plugins: [
169
...(isEsEnv ? [] : ['add-module-exports']),

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ logs
66
*.log
77
npm-debug.log*
88

9+
dist
910
lib
1011
es
1112
.DS_Store

package-lock.json

Lines changed: 149 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
"micromatch": "3.1.10",
3333
"prettier": "1.12.1",
3434
"rimraf": "2.6.2",
35+
"rollup": "0.59.3",
36+
"rollup-plugin-babel": "3.0.4",
37+
"rollup-plugin-node-resolve": "3.3.0",
38+
"rollup-plugin-uglify": "4.0.0",
3539
"when": "3.7.8"
3640
},
3741
"directories": {
@@ -72,15 +76,18 @@
7276
"main": "lib",
7377
"jsnext:main": "es",
7478
"module": "es",
79+
"unpkg": "dist/common-tags.min.js",
80+
"files": ["dist", "es", "lib"],
7581
"repository": {
7682
"type": "git",
7783
"url": "https://github.com/declandewet/common-tags"
7884
},
7985
"scripts": {
8086
"clear": "rimraf lib && rimraf es",
81-
"build": "npm run clear && npm run build:cjs && npm run build:es",
87+
"build": "npm run clear && npm run build:cjs && npm run build:es && npm run build:unpkg",
8288
"build:cjs": "babel src -d lib --ignore *.test.js",
8389
"build:es": "cross-env BABEL_ENV=es babel src -d es --ignore *.test.js",
90+
"build:unpkg": "cross-env BABEL_ENV=es rollup --config",
8491
"codecov": "codecov",
8592
"doctoc": "doctoc readme.md --title \"\n## Table of Contents\"",
8693
"lint": "eslint .*rc.js src/**/*.js --ignore-pattern '!.*rc.js'",

rollup.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import babel from 'rollup-plugin-babel';
2+
import resolve from 'rollup-plugin-node-resolve';
3+
import { uglify } from 'rollup-plugin-uglify';
4+
5+
export default {
6+
input: 'src/index.js',
7+
output: {
8+
extend: true,
9+
file: 'dist/common-tags.min.js',
10+
format: 'umd',
11+
indent: false,
12+
name: 'commonTags',
13+
},
14+
plugins: [babel(), resolve(), uglify()],
15+
};

0 commit comments

Comments
 (0)