Skip to content
Permalink
Browse files

Build UMD dist file with Rollup

  • Loading branch information
mislav committed May 17, 2018
1 parent 0a57487 commit 432bf07785d051f61c90904cb0198ec2b2bf1d4d
Showing with 20 additions and 4 deletions.
  1. +1 −0 .gitignore
  2. +4 −1 Makefile
  3. +5 −1 package.json
  4. +8 −0 rollup.config.js
  5. +1 −1 test/test.html
  6. +1 −1 test/worker.js
@@ -1,5 +1,6 @@
.env
package-lock.json
dist/
bower_components/
node_modules/
sauce_connect/
@@ -1,9 +1,12 @@
test: node_modules/ lint
test: lint dist/fetch.umd.js
./script/test

lint: node_modules/
./node_modules/.bin/eslint --report-unused-disable-directives *.js test/*.js

dist/fetch.umd.js: fetch.js rollup.config.js node_modules/
./node_modules/.bin/rollup -c

node_modules/:
npm install

@@ -2,7 +2,8 @@
"name": "whatwg-fetch",
"description": "A window.fetch polyfill.",
"version": "2.0.3",
"main": "fetch.js",
"main": "./dist/fetch.umd.js",
"module": "./fetch.js",
"repository": "github/fetch",
"license": "MIT",
"devDependencies": {
@@ -12,13 +13,16 @@
"mocha": "2.1.0",
"mocha-phantomjs-core": "2.0.1",
"promise-polyfill": "6.0.2",
"rollup": "^0.59.1",
"url-search-params": "0.6.1"
},
"files": [
"LICENSE",
"dist/fetch.umd.js",
"fetch.js"
],
"scripts": {
"prepublish": "make dist/fetch.umd.js",
"test": "make"
}
}
@@ -0,0 +1,8 @@
export default {
input: 'fetch.js',
output: {
file: 'dist/fetch.umd.js',
format: 'umd',
name: 'WHATWGFetch'
}
}
@@ -34,7 +34,7 @@

<script src="/node_modules/promise-polyfill/promise.js"></script>
<script src="/test/test.js"></script>
<script src="/fetch.js"></script>
<script src="/dist/fetch.umd.js"></script>

<script>
var runner = mocha.run();
@@ -6,7 +6,7 @@ self.assert = chai.assert

importScripts('/node_modules/promise-polyfill/promise.js')
importScripts('/test/test.js')
importScripts('/fetch.js')
importScripts('/dist/fetch.umd.js')

function title(test) {
return test.fullTitle().replace(/#/g, '')

0 comments on commit 432bf07

Please sign in to comment.