-
-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add client side build functionality (#45)
- Loading branch information
Showing
8 changed files
with
69 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,5 @@ node_modules | |
|
||
# Users Environment Variables | ||
.lock-wscript | ||
|
||
dist/ |
3 changes: 3 additions & 0 deletions
3
packages/generator-feathers-plugin/app/templates/client/_babelrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": [ ["es2015", { "loose": true }] ] | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/generator-feathers-plugin/app/templates/client/package.json.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const camelCase = require('lodash/camelCase'); | ||
|
||
module.exports = function(pkg) { | ||
const { scripts, name } = pkg; | ||
|
||
Object.assign(scripts, { | ||
clean: 'shx rm -rf dist/ && shx mkdir -p dist', | ||
prepublish: 'npm run browserify', | ||
'browserify:dist': `browserify lib/index.js -t babelify --standalone ${camelCase(name)} --outfile dist/${name}.js`, | ||
'browserify:min': `browserify lib/index.js -t babelify --standalone ${camelCase(name)} | uglifyjs > dist/${name}.min.js`, | ||
browserify: 'npm run clean && npm run browserify:dist && npm run browserify:min', | ||
'add-dist': 'npm run browserify && git add dist/ --force && git commit -am "Updating dist"', | ||
'release:pre': 'npm run add-dist && npm version prerelease && npm publish --tag pre', | ||
'release:patch': 'npm run add-dist && npm version patch && npm publish', | ||
'release:minor': 'npm run add-dist && npm version minor && npm publish', | ||
'release:major': 'npm run add-dist && npm version major && npm publish', | ||
test: 'npm run browserify && npm run lint && npm run coverage' | ||
}); | ||
|
||
return pkg; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
// import errors from 'feathers-errors'; | ||
const debug = require('debug')('<%= name %>'); | ||
|
||
module.exports = function init () { | ||
debug('Initializing <%= name %> plugin'); | ||
return '<%= name %>'; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters