Skip to content

Commit 61c5d80

Browse files
committed
chore: add UMD build to npm package
1 parent 6c67744 commit 61c5d80

File tree

4 files changed

+122
-31
lines changed

4 files changed

+122
-31
lines changed

azure-pipelines.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
- script: npm ci
1414
displayName: 'Install dependencies'
1515

16+
- script: npm run build
17+
displayName: 'Webpack build'
18+
1619
- script: npm test
1720
displayName: 'Run tests'
1821
env:

package-lock.json

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

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@
66
"version": "0.0.0-development",
77
"description": "A lean and fast 'fs' for the browser",
88
"main": "src/index.js",
9+
"unpkg": "dist/lightning-fs.min.js",
910
"bin": {
1011
"superblocktxt": "src/superblocktxt.js"
1112
},
1213
"scripts": {
1314
"test": "karma start --single-run",
15+
"build": "webpack",
1416
"semantic-release": "semantic-release"
1517
},
1618
"dependencies": {
1719
"idb-keyval": "3.1.0",
1820
"isomorphic-textencoder": "1.0.1",
1921
"just-debounce-it": "1.1.0",
20-
"just-once": "1.1.0",
21-
"print-tree": "0.1.5"
22+
"just-once": "1.1.0"
2223
},
2324
"devDependencies": {
2425
"karma": "^3.1.1",
@@ -34,7 +35,8 @@
3435
"prettier": "^1.15.3",
3536
"puppeteer": "^1.10.0",
3637
"semantic-release": "^15.13.1",
37-
"webpack": "^4.26.0"
38+
"webpack": "^4.28.2",
39+
"webpack-cli": "^3.1.2"
3840
},
3941
"repository": {
4042
"type": "git",

webpack.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const path = require('path')
2+
3+
module.exports = {
4+
target: "webworker",
5+
output: {
6+
path: path.resolve(__dirname, "dist"),
7+
filename: "lightning-fs.min.js",
8+
library: "LightningFS",
9+
libraryTarget: "umd",
10+
},
11+
};

0 commit comments

Comments
 (0)