- Update
package.json, setversionto a prerelease version, e.g.2.0.0-rc1,3.1.5-rc4, ... - Run
npm packto create package - Run
npm publish <package>.tgz --tag nextto publish the package under thenexttag - Run
npm install --save package@nextto install prerelease package
This file contains hidden or 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
| /** | |
| |-------------------------------------------------------------------------- | |
| | gulp browser-sync | |
| |-------------------------------------------------------------------------- | |
| * | |
| * Browser Sync | |
| * @description Refresh the Brwoser after File Change. | |
| * Combined with webpack for HMR or Content Reload | |
| * | |
| * @package generator-mh-boilerplate |
This file contains hidden or 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
| // | |
| // Quick & Dirty Google Cloud Storage emulator for tests. Requires | |
| // `stream-buffers` from npm. Use it like this: | |
| // | |
| // `new MockStorage().bucket('my-bucket').file('my_file').createWriteStream()` | |
| // | |
| class MockStorage { | |
| buckets: {[name: string]: MockBucket}; |
This file contains hidden or 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
| const webpack = require('webpack'); | |
| const WebpackDevServer = require('webpack-dev-server'); | |
| const webpackConfig = require('./webpack.config.js'); | |
| const browserSync = require('browser-sync'); | |
| // a nice npm module written to have BrowserSync work with Webpack | |
| // and webpack-dev-server | |
| const BrowserSyncPlugin = require('browser-sync-webpack-plugin'); | |
| const renderTemplate = require('./build/gulp/template'); | |
| const clients = require('./build/gulp/clients')(); | |
| let browserSyncInstance; |
This file contains hidden or 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
| axios({ | |
| url: 'http://localhost:5000/static/example.pdf', | |
| method: 'GET', | |
| responseType: 'blob', // important | |
| }).then((response) => { | |
| const url = window.URL.createObjectURL(new Blob([response.data])); | |
| const link = document.createElement('a'); | |
| link.href = url; | |
| link.setAttribute('download', 'file.pdf'); | |
| document.body.appendChild(link); |
This file contains hidden or 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
| var observeDOM = (function(){ | |
| var MutationObserver = window.MutationObserver || window.WebKitMutationObserver, | |
| eventListenerSupported = window.addEventListener; | |
| return function(obj, callback){ | |
| if( MutationObserver ){ | |
| // define a new observer | |
| var obs = new MutationObserver(function(mutations, observer){ | |
| if( mutations[0].addedNodes.length || mutations[0].removedNodes.length ) | |
| callback(); |
This file contains hidden or 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
| { | |
| "directory": "wwwroot/scripts/bower" | |
| } |
This file contains hidden or 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
| #! /usr/bin/env node | |
| /* eslint-env node */ | |
| // Boot it up with: | |
| // $ node customDevServer.js | |
| // ...or: | |
| // $ chmod +X customDevServer.js | |
| // $ ./customDevServer.js | |
| const webpack = require('webpack'); |
A simple Webpack + Gulpfile configuration wihtout any need for React.js that assumes you have the following project structure:
node_modules/
bower_components/
scripts/
Entry script is in scripts/entry.js
You should run gulp && gulp build-dev and you are good to go.