0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Updated build and publish setup for unpkg deployment

refs https://github.com/TryGhost/members.js/issues/12

- Updates package name and add umd/unpkg setup in `package.json`
- Updated webpack config to publish minified bundle at `umd/memebrs.min.js`
- Updated .gitignore to remove build folders
This commit is contained in:
Rish 2020-04-20 22:10:58 +05:30
parent 89a1cab4c1
commit 028139a0e1
3 changed files with 14 additions and 5 deletions

View file

@ -68,8 +68,9 @@ typings/
# OSX
.DS_Store
# Membersjs Custom
build
# Membersjs build folders
umd/
build/
## config
.env.local

View file

@ -1,9 +1,15 @@
{
"name": "membersjs",
"name": "@tryghost/members-js",
"version": "0.1.0",
"license": "MIT",
"repository": "git@github.com:TryGhost/membersjs.git",
"author": "Ghost Foundation",
"unpkg": "umd/members.min.js",
"files": [
"umd/",
"LICENSE",
"README.md"
],
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
@ -21,7 +27,8 @@
"test": "react-scripts test",
"eject": "react-scripts eject",
"lint": "eslint src --ext .js --cache",
"posttest": "yarn lint"
"posttest": "yarn lint",
"prepublishOnly": "yarn build"
},
"eslintConfig": {
"extends": ["react-app", "plugin:ghost/browser"],

View file

@ -6,7 +6,8 @@ module.exports = {
'bundle.js': glob.sync('build/static/?(js|css)/main.*.?(js|css)').map(f => path.resolve(__dirname, f))
},
output: {
filename: 'build/static/js/bundle.min.js'
filename: 'members.min.js',
path: __dirname + '/umd'
},
module: {
rules: [