Skip to content

Commit 725da9b

Browse files
committed
update umd build script to support unpkg.com
1 parent 37de9f4 commit 725da9b

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jspm_packages
3636

3737
# Lib
3838
lib
39+
umd
40+
umd-temp
3941

4042
others
4143
.DS_Store

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ yarn.lock
1616
src
1717
test
1818
examples
19+
umd-temp
1920
CHANGELOG.md
2021
.travis.yml
2122
.editorconfig

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Supabase Realtime API",
55
"main": "./lib/index.js",
66
"scripts": {
7-
"clean": "rimraf lib",
7+
"clean": "rimraf lib && rimraf umd && rimraf umd-temp",
88
"test": "mocha -r @babel/register -r babel-polyfill test/unit/**/*.js",
99
"test:integration": "mocha -r @babel/register -r babel-polyfill test/integration/**/*.js",
1010
"test:auth": "mocha --timeout 10000 -r @babel/register -r babel-polyfill test/integration/testAuth.js",
@@ -14,8 +14,8 @@
1414
"test:examples": "node examples/",
1515
"cover": "nyc --check-coverage && npm test",
1616
"build": "BABEL_ENV=production babel src --out-dir lib",
17-
"build:umd": "BABEL_ENV=production babel --plugins @babel/plugin-transform-modules-umd src --out-dir lib && webpack",
18-
"prepublish": "npm run clean && npm run build",
17+
"build:umd": "BABEL_ENV=production babel --plugins @babel/plugin-transform-modules-umd src --out-dir umd-temp && webpack",
18+
"prepublish": "npm run clean && npm run build && npm run build:umd",
1919
"deploy:minor": "npm version minor && npm publish --access=public",
2020
"deploy:patch": "npm version patch && npm publish --access=public"
2121
},

webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ const path = require('path');
22

33
module.exports = {
44
mode: 'production',
5-
entry: './lib/index.js',
5+
entry: './umd-temp/index.js',
66
output: {
7-
path: path.resolve(__dirname, 'lib'),
7+
path: path.resolve(__dirname, 'umd'),
88
filename: 'supabase.js',
99
library: 'Supabase',
1010
libraryTarget: 'var'

0 commit comments

Comments
 (0)