Skip to content

Commit

Permalink
STRF-10125 Bundle libary to js file (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
jairo-bc authored Oct 18, 2022
1 parent 21ceaf4 commit 48580c9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
with:
node-version: '14.x'
- run: npm i
- run: npm run build
# Setup .npmrc file to publish to npm registry
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
- run: npm publish
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
.idea
package-lock.json
dist
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@
"main": "index.js",
"author": "Bigcommerce",
"license": "BSD-4-Clause",
"files": [
"dist/",
"helpers/",
"lib/",
"helpers.js",
"index.js"
],
"scripts": {
"build": "webpack",
"lint": "eslint .",
"lint-and-fix": "eslint . --fix",
"test": "lab -v -t 97.4 --ignore FinalizationRegistry,WeakRef,WebAssembly,_time,format,SharedArrayBuffer,Atomics,BigUint64Array,BigInt64Array,BigInt,URL,URLSearchParams,TextEncoder,TextDecoder,queueMicrotask spec",
Expand Down Expand Up @@ -39,7 +47,11 @@
"eslint": "^7.8.1",
"highlight.js": "^11.6.0",
"lab": "~13.0.4",
"sinon": "~7.5.0"
"path-browserify": "^1.0.1",
"sinon": "~7.5.0",
"url": "^0.11.0",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
},
"engines": {
"node": ">=10"
Expand Down
23 changes: 23 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const path = require('path');

module.exports = {
entry: './index.js',
mode: 'production',
devtool: false,
output: {
filename: 'blackbird-handlebars.js',
path: path.resolve(__dirname, 'dist'),
library: 'BlackbirdHandlebars',
},
resolve:
{
fallback: {
"path": require.resolve("path-browserify"),
"url": require.resolve("url/")
},
alias: {
'handlebars-v4': 'handlebars-v4/dist/handlebars.js',
'handlebars': 'handlebars/dist/handlebars.js'
}
},
};

0 comments on commit 48580c9

Please sign in to comment.