Added logging, changed some directory structure

This commit is contained in:
2018-01-13 21:33:40 -05:00
parent f079a5f067
commit 8e72ffb917
73656 changed files with 35284 additions and 53718 deletions

View File

@@ -0,0 +1,8 @@
node_modules/
src/
examples/
test/
.github/
circle.yml
.babelrc
.eslintrc

View File

@@ -0,0 +1,158 @@
## 0.11.4
* Update to webpack 3
## 0.11.3
* avoid promisifying fs ops (fixes #81) (#82)
## 0.11.2
* Update uglify-js usage to v3 api
## 0.11.1
* :arrow_up: Update dependencies
* Update example in readme
* Remove unused Template var from tests
* Fix errors for MultiCompilers build (#78)
* Add strip prefix multi windows support (#76)
## 0.11.0
* Added [chunkhash]/[hash]/[id]/[name] support for importScripts (#70)
## 0.10.1
* Update npmignore files
## 0.10.0
* Update unit tests
* Modularize and refactor
* Remove forceDelete
* Add debug option
* Add final webpack-dev-server notes to readme
* Remove unaffected sw-precache options from readme
## 0.9.1
* Lower node engine requirement to 4.0.0
* Remove unused packages from example
* :arrow_up: Update dependencies
## 0.9.0
* Remove deprecated eslint-plugin-babel options, and drop the whole plugin now that it's no longer used.
* Refactor merge behavior
* Add support for staticFileGlobs option and stripPrefix(Multi) by merging them with the webpack values.
## 0.8.0
* Add minify to docs
* update sw-precache version
* Add option to minify ServiceWorker file (#25)
## 0.7.2
* Add warning when using filepath option
* Fix failing tests from pr #38
* pass force option to `del` (#38)
## 0.7.1
* Update webpack peer dependency
* Add error handling for promise
* Hook plugin to 'after-emit' to ensure async execution
* Correct typos
## 0.7.0
* Refactor importScripts default behavior
* Fix preserving the [hash], so it will update the new hash when running in watch mode
## 0.6.3
* Use publicPath for importScripts
## 0.6.2
* Array.from returning empty array
* Use async/await for writeServiceWorker test
## 0.6.1
* Update dependencies
* Add unit tests for writeServiceWorker and apply methods
* Remove useless getAssetGlobs function
## 0.6.0
* Add spec tests and basic test [WIP]
* Update dependencies
* Allow to use [hash] on importScripts
* Fix typo
* Add circleci config
* Add node engine
## 0.5.1
* Add webpack 2 beta peer dependency
* Remove some of example
## 0.5.0
* Add test
* Add `staticFileGlobsIgnorePatterns` option
## 0.4.0
* Add link to official register example
* Update dependencies
## 0.3.1
* Update example to use filename and isolate service-worker script
* Fix filename option
## 0.3.0
* Drop support for options.options
* Add trailing / to output.path for stripPrefix
## 0.2.4
* fixed missing dependency
* Update readmes with better examples, explanations and badges
* Fix example link
* Fix example errors
## 0.2.3
* Add example project
* Use compilation assets instead of chunk.files
## 0.2.1
* Add eslint babel
* Update readme with options instructions and example
* Make options object passable as single argument
## 0.2.0
* Add changelog
* Fix package comma
* Add makefile
* Add eslint dependencies
* Fix babel-es2015 reference
* Allow options parameter to override config
* Add babel
* Move source into src dir
## 0.1.0
* Initial release
# Change Log
All enhancements and patches to sw-precache-webpack-plugin will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

View File

@@ -0,0 +1,46 @@
BUILD_CMD := ./node_modules/.bin/babel ./src -d ./lib --ignore 'test' --presets latest,stage-0
TEST_CMD := ./node_modules/.bin/ava test/plugin.spec.js
build_es6:
@$(BUILD_CMD)
ci:
@$(BUILD_CMD) --watch
clean:
@rm -rf ./lib
@rm -rf ./test/tmp
build: clean build_es6
lint:
@node_modules/.bin/eslint src
unit_test: build
@$(TEST_CMD)
integration_test: build
@cd examples && npm install && npm t && npm run webpack
test: lint build unit_test integration_test
major:
npm version major
minor:
npm version minor
patch:
npm version patch
changelog.template.ejs:
@echo "## x.x.x\n\n<% commits.forEach(function(commit) { -%>\n* <%= commit.title %>\n<% }) -%>" > changelog.template.ejs
changelog: changelog.template.ejs
@touch CHANGELOG.md
@git-release-notes $$(git describe --abbrev=0)..HEAD $< | cat - CHANGELOG.md >> CHANGELOG.md.new
@mv CHANGELOG.md{.new,}
@rm changelog.template.ejs
@echo "Added changes since $$(git describe --abbrev=0) to CHANGELOG.md"
.PHONY: clean dev lint examples test major minor patch

View File

@@ -0,0 +1,218 @@
# SW Precache Webpack Plugin
[![NPM version][npm-img]][npm-url]
[![NPM downloads][npm-downloads-img]][npm-url]
[![CircleCI][circleci-img]][circleci-url]
__`SWPrecacheWebpackPlugin`__ is a [webpack][webpack] plugin for using [service workers][sw-guide] to cache your external project dependencies. It will generate a service worker file using [sw-precache][sw-precache] and add it to your build directory.
## Install
```bash
npm install --save-dev sw-precache-webpack-plugin
```
## Basic Usage
A simple configuration example that will work well in most production environments. Based on the configuration used in [create-react-app].
```javascript
var path = require('path');
var SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');
const PUBLIC_PATH = 'https://www.my-project-name.com/'; // webpack needs the trailing slash for output.publicPath
module.exports = {
entry: {
main: path.resolve(__dirname, 'src/index'),
},
output: {
path: path.resolve(__dirname, 'src/bundles/'),
filename: '[name]-[hash].js',
publicPath: PUBLIC_PATH,
},
plugins: [
new SWPrecacheWebpackPlugin(
{
cacheId: 'my-project-name',
dontCacheBustUrlsMatching: /\.\w{8}\./,
filename: 'service-worker.js',
minify: true,
navigateFallback: PUBLIC_PATH + 'index.html',
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/],
}
),
],
}
```
This will generate a new service worker at `src/bundles/service-worker.js`.
Then you would just register it in your application:
```javascript
(function() {
if('serviceWorker' in navigator) {
navigator.serviceWorker.register('/my-service-worker.js');
}
})();
```
[Another example of registering a service worker is provided by GoogleChrome/sw-precache][sw-precache-registration-example]
## Configuration
You can pass a hash of configuration options to `SWPrecacheWebpackPlugin`:
__plugin options__:
* `filename`: `[String]` - Service worker filename, default is `service-worker.js`
* `filepath`: `[String]` - Service worker path and name, default is to use `webpack.output.path` + `options.filename`. This will override `filename`. *Warning: Make the service worker available in the same directory it will be needed. This is because the scope of the service worker is defined by the directory the worker exists.*
* `staticFileGlobsIgnorePatterns`: `[RegExp]` - Define an optional array of regex patterns to filter out of staticFileGlobs (see below)
* `mergeStaticsConfig`: `[boolean]` - Merge provided staticFileGlobs and stripPrefixMulti with webpack's config, rather than having those take precedence, default is false.
* `minify`: `[boolean]` - Set to true to minify and uglify the generated service-worker, default is false.
[__`sw-precache` options__][sw-precache-options]:
Pass any option from `sw-precache` into your configuration. Some of these will be automatically be populated if you do not specify the value and a couple others will be modified to be more compatible with webpack. Options that are populated / modified:
* `cacheId`: `[String]` - Not required but you should include this, it will give your service worker cache a unique name. Defaults to "sw-precache-webpack-plugin".
* `importScripts`: `[Array<String|Object>]`
- When importScripts array item is a `String`:
- Converts to object format `{ filename: '<publicPath>/my-script.js'}`
- When importScripts array item is an `Object`:
- Looks for `chunkName` property.
- Looks for `filename` property.
- **If a `chunkName` is specified, it will override the accompanied value for `filename`.**
* `replacePrefix`: `[String]` - Should only be used in conjunction with `stripPrefix`
* `staticFileGlobs`: `[Array<String>]` - Omit this to allow the plugin to cache all your bundles' emitted assets. If `mergeStaticsConfig=true`: this value will be merged with your bundles' emitted assets, otherwise this value is just passed to `sw-precache` and emitted assets won't be included.
* `stripPrefix`: `[String]` - Same as `stripPrefixMulti[stripPrefix] = ''`
* `stripPrefixMulti`: `[Object<String,String>]` - Omit this to use your webpack config's `output.path + '/': output.publicPath`. If `mergeStaticsConfig=true`, this value will be merged with your webpack's `output.path: publicPath` for stripping prefixes. Otherwise this property will be passed directly to `sw-precache` and Webpack's output path won't be replaced.
_Note that all configuration options are optional. `SWPrecacheWebpackPlugin` will by default use all your assets emitted by webpack's compiler for the `staticFileGlobs` parameter and your webpack config's `{[output.path + '/']: output.publicPath}` as the `stripPrefixMulti` parameter. This behavior is probably what you want, all your webpack assets will be cached by your generated service worker. Just don't pass any arguments when you initialize this plugin, and let this plugin handle generating your `sw-precache` configuration._
## Examples
See the [examples documentation][example-project] or the implementation in [create-react-app].
### Simplest Example
No arguments are required by default, `SWPrecacheWebpackPlugin` will use information provided by webpack to generate a service worker into your build directory that caches all your webpack assets.
```javascript
module.exports = {
...
plugins: [
new SWPrecacheWebpackPlugin(),
],
...
}
```
### Advanced Example
Here's a more elaborate example with `mergeStaticsConfig: true` and `staticFileGlobsIgnorePatterns`. `mergeStaticsConfig: true` allows you to add some additional static file globs to the emitted ServiceWorker file alongside Webpack's emitted assets. `staticFileGlobsIgnorePatterns` can be used to avoid including sourcemap file references in the generated ServiceWorker.
```javascript
plugins: [
new SWPrecacheWebpackPlugin({
cacheId: 'my-project-name',
filename: 'my-project-service-worker.js',
staticFileGlobs: [
'src/static/img/**.*',
'src/static/styles.css',
],
stripPrefix: 'src/static/', // stripPrefixMulti is also supported
mergeStaticsConfig: true, // if you don't set this to true, you won't see any webpack-emitted assets in your serviceworker config
staticFileGlobsIgnorePatterns: [/\.map$/], // use this to ignore sourcemap files
}),
]
```
### `importScripts` usage example
Accepts an array of `<String|Object>`'s. `String` entries are legacy supported. Use `filename` instead.
If `importScripts` item is object, there are 2 possible properties to set on this object:
- **filename**: Use this if you are referencing a path that "you just know" exists. You probably don't want to use this for named chunks.
- **chunkName**: Supports named entry chunks & dynamically imported named chunks.
```javascript
entry: {
main: __dirname + '/src/index.js',
sw: __dirname + '/src/service-worker-entry.js'
},
output: {
publicPath: '/my/public/path',
chunkfileName: '[name].[<hash|chunkhash>].js'
},
plugins: [
new SWPrecacheWebpackPlugin({
filename: 'my-project-service-worker.js',
importSripts: [
// * legacy supported
// [chunkhash] is not supported for this usage
// This is transformed to new object syntax:
// { filename: '/my/public/path/some-known-script-path.js' }
'some-known-script-path.js',
// This use case is identical to above, except
// for excluding the .[hash] part:
{ filename: 'some-known-script-path.[hash].js' },
// When [chunkhash] is specified in filename:
// - filename must match the format specified in output.chunkfileName
// - If chunkName is invalid; an error will be reported
{ chunkName: 'sw' },
// Works for named entry chunks & dynamically imported named chunks:
// For ex, if in your code is:
// import(/* webpackChunkName: "my-named-chunk" */ './my-async-script.js');
{ chunkName: 'my-named-chunk' },
// All importSripts entries resolve to a string, therefore
// the final output of the above input is:
// [
// '/my/public/path/some-known-script-path.js',
// '/my/public/path/some-known-script-path.<compilation hash>.js',
// '/my/public/path/some-known-script-path.<chunkhash>.js',
// '/my/public/path/<id>.my-named-chunk.<chunkhash>.js'
// ]
]
}),
]
```
## Webpack Dev Server Support
Currently `SWPrecacheWebpackPlugin` will not work with `Webpack Dev Server`. If you wish to test the service worker locally, you can use simple a node server [see example project][example-project] or `python SimpleHTTPServer` from your build directory. I would suggest pointing your node server to a different port than your usual local development port and keeping the precache service worker out of your [local configuration (example)][webpack-local-config-example].
There will likely never be `webpack-dev-server` support. `sw-precache` needs physical files in order to generate the service worker. Webpack-dev-server files are in-memory. It is only possible to provide `sw-precache` with globs to find these files. It will follow the glob pattern and generate a list of file names to cache.
## Contributing
Install node dependencies:
```
$ npm install
```
Or:
```
$ yarn
```
Add unit tests for your new feature in `./test/plugin.spec.js`
## Testing
Tests are located in `./test`
Run tests:
```
$ npm t
```
<!--references-->
[sw-guide]: https://github.com/goldhand/notes/blob/master/notes/service_workers.md "Introduction to service workers"
[sw-precache]: https://github.com/GoogleChrome/sw-precache "SW-Precache"
[sw-precache-options]: https://github.com/GoogleChrome/sw-precache#options-parameter "SW-Precache Options"
[sw-precache-registration-example]: https://github.com/GoogleChrome/sw-precache/blob/5699e5d049235ef0f668e8e2aa3bf2646ba3872f/demo/app/js/service-worker-registration.js
[example-project]: /examples/
[webpack]: http://webpack.github.io/
[webpack-local-config-example]: https://github.com/goldhand/cookiecutter-webpack/blob/986151474b60dc19166eba18156a1f9dbceecb98/%7B%7Bcookiecutter.repo_name%7D%7D/webpack.local.config.js "Webpack local config example"
[create-react-app]: https://github.com/facebookincubator/create-react-app/blob/e91648a9bb55230fa15a7867fd5b730d7e1a5808/packages/react-scripts/config/webpack.config.prod.js#L308
[npm-url]: https://npmjs.org/package/sw-precache-webpack-plugin
[npm-img]: https://badge.fury.io/js/sw-precache-webpack-plugin.svg
[npm-downloads-img]: https://img.shields.io/npm/dm/sw-precache-webpack-plugin.svg?style=flat-square
[daviddm-img]: https://david-dm.org/goldhand/sw-precache-webpack-plugin.svg
[daviddm-url]: https://david-dm.org/goldhand/sw-precache-webpack-plugin
[circleci-img]: https://circleci.com/gh/goldhand/sw-precache-webpack-plugin.svg?style=svg
[circleci-url]: https://circleci.com/gh/goldhand/sw-precache-webpack-plugin

View File

@@ -0,0 +1,279 @@
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _path = require('path');
var _path2 = _interopRequireDefault(_path);
var _url = require('url');
var _url2 = _interopRequireDefault(_url);
var _swPrecache = require('sw-precache');
var _swPrecache2 = _interopRequireDefault(_swPrecache);
var _uglifyJs = require('uglify-js');
var _uglifyJs2 = _interopRequireDefault(_uglifyJs);
var _util = require('util');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var FILEPATH_WARNING = 'sw-prechache-webpack-plugin [filepath]: You are using a custom path for your service worker, this may prevent the service worker from working correctly if it is not available in the same path as your application.';
var FORCEDELETE_WARNING = 'sw-prechache-webpack-plugin [forceDelete]: You are specifying the option forceDelete. This was removed in v0.10. It should not affect your build but should no longer be required.';
var DEFAULT_CACHE_ID = 'sw-precache-webpack-plugin',
DEFAULT_WORKER_FILENAME = 'service-worker.js',
DEFAULT_PUBLIC_PATH = '',
DEFAULT_IMPORT_SCRIPTS = [],
DEFAULT_IGNORE_PATTERNS = [],
CHUNK_NAME_NOT_FOUND_ERROR = 'Could not locate files for chunkName: "%s"',
// eslint-disable-next-line max-len
CHUNK_NAME_OVERRIDES_FILENAME_WARNING = 'Don\'t use chunkName & filename together; importScripts[<index>].filename overriden by specified chunkName: %j';
var DEFAULT_OPTIONS = {
cacheId: DEFAULT_CACHE_ID,
filename: DEFAULT_WORKER_FILENAME,
importScripts: DEFAULT_IMPORT_SCRIPTS,
staticFileGlobsIgnorePatterns: DEFAULT_IGNORE_PATTERNS,
mergeStaticsConfig: false,
minify: false
};
var SWPrecacheWebpackPlugin = function () {
/**
* SWPrecacheWebpackPlugin - A wrapper for sw-precache to use with webpack
* @constructor
* @param {object} options - All parameters should be passed as a single options object. All sw-precache options can be passed here in addition to plugin options.
*
* // plugin options:
* @param {string} [options.filename] - Service worker filename, default is 'service-worker.js'
* @param {string} [options.filepath] - Service worker path and name, default is to use webpack.output.path + options.filename
* @param {RegExp} [options.staticFileGlobsIgnorePatterns[]] - Define an optional array of regex patterns to filter out of staticFileGlobs
* @param {boolean} [options.mergeStaticsConfig=false] - Merge provided staticFileGlobs and stripPrefix(Multi) with webpack's config, rather than having those take precedence
* @param {boolean} [options.minify=false] - Minify the generated Service worker file using UglifyJS
* @param {boolean} [options.debug=false] - Output error and warning messages
*/
function SWPrecacheWebpackPlugin(options) {
_classCallCheck(this, SWPrecacheWebpackPlugin);
// generated configuration options
this.config = {};
// configuration options passed by user
this.options = _extends({}, DEFAULT_OPTIONS, options);
// generated configuration that will override user options
this.overrides = {};
// push warning messages here
this.warnings = [];
}
/**
* @returns {object} - plugin configuration
*/
_createClass(SWPrecacheWebpackPlugin, [{
key: 'apply',
value: function apply(compiler) {
var _this = this;
// sw-precache needs physical files to reference so we MUST wait until after assets are emitted before generating the service-worker.
compiler.plugin('after-emit', function (compilation, callback) {
_this.configure(compiler, compilation); // configure the serviceworker options
_this.checkWarnings(compilation);
// generate service worker then write to file system
_this.createServiceWorker().then(function (serviceWorker) {
return _this.writeServiceWorker(serviceWorker, compiler);
}).then(function () {
return callback();
}).catch(function (err) {
return callback(err);
});
});
}
}, {
key: 'configure',
value: function configure(compiler, compilation) {
// get the defaults from options
var _options = this.options,
importScripts = _options.importScripts,
staticFileGlobsIgnorePatterns = _options.staticFileGlobsIgnorePatterns,
mergeStaticsConfig = _options.mergeStaticsConfig,
_options$stripPrefixM = _options.stripPrefixMulti,
stripPrefixMulti = _options$stripPrefixM === undefined ? {} : _options$stripPrefixM;
// get the output path used by webpack
var outputPath = compiler.outputPath;
// outputPath + filename or the user option
var _options$filepath = this.options.filepath,
filepath = _options$filepath === undefined ? _path2.default.resolve(outputPath, this.options.filename) : _options$filepath;
// get the public path specified in webpack config
var _compiler$options$out = compiler.options.output.publicPath,
publicPath = _compiler$options$out === undefined ? DEFAULT_PUBLIC_PATH : _compiler$options$out;
// get all assets outputted by webpack
var assetGlobs = Object.keys(compilation.assets).map(function (f) {
return _path2.default.join(outputPath, f);
});
// merge assetGlobs with provided staticFileGlobs and filter using staticFileGlobsIgnorePatterns
var staticFileGlobs = assetGlobs.concat(this.options.staticFileGlobs || []).filter(function (text) {
return !staticFileGlobsIgnorePatterns.some(function (regex) {
return regex.test(text);
});
});
if (outputPath) {
// strip the webpack config's output.path (replace for windows users)
stripPrefixMulti[('' + outputPath + _path2.default.sep).replace(/\\/g, '/')] = publicPath;
}
this.config = _extends({}, this.config, {
staticFileGlobs: staticFileGlobs,
stripPrefixMulti: stripPrefixMulti
});
// set the actual filepath
this.overrides.filepath = filepath;
// resolve [hash] used in importScripts
this.configureImportScripts(importScripts, publicPath, compiler, compilation);
if (mergeStaticsConfig) {
// merge generated and user provided options
this.overrides = _extends({}, this.overrides, {
staticFileGlobs: staticFileGlobs,
stripPrefixMulti: stripPrefixMulti
});
}
}
}, {
key: 'configureImportScripts',
value: function configureImportScripts(importScripts, publicPath, compiler, compilation) {
var _this2 = this;
if (!importScripts) {
return;
}
var _compilation$getStats = compilation.getStats().toJson({ hash: true, chunks: true }),
hash = _compilation$getStats.hash,
chunks = _compilation$getStats.chunks;
this.overrides.importScripts = importScripts.reduce(function (fileList, criteria) {
// legacy support for importScripts items defined as string
if (typeof criteria === 'string') {
criteria = { filename: criteria };
}
var hasFileName = !!criteria.filename;
var hasChunkName = !!criteria.chunkName;
if (hasFileName && hasChunkName) {
_this2.warnings.push(new Error((0, _util.format)(CHUNK_NAME_OVERRIDES_FILENAME_WARNING, criteria)));
}
if (hasChunkName) {
var chunk = chunks.find(function (c) {
return c.names.includes(criteria.chunkName);
});
if (!chunk) {
compilation.errors.push(new Error((0, _util.format)(CHUNK_NAME_NOT_FOUND_ERROR, criteria.chunkName)));
return fileList;
}
var chunkFileName = chunk.files[chunk.names.indexOf(criteria.chunkName)];
fileList.push(_url2.default.resolve(publicPath, chunkFileName));
} else if (hasFileName) {
var hashedFilename = criteria.filename.replace(/\[hash\]/g, hash);
fileList.push(_url2.default.resolve(publicPath, hashedFilename));
}
return fileList;
}, []);
}
}, {
key: 'createServiceWorker',
value: function createServiceWorker() {
var _this3 = this;
return _swPrecache2.default.generate(this.workerOptions).then(function (serviceWorkerFileContents) {
if (_this3.options.minify) {
var uglifyFiles = {};
uglifyFiles[_this3.options.filename] = serviceWorkerFileContents;
return _uglifyJs2.default.minify(uglifyFiles).code;
}
return serviceWorkerFileContents;
});
}
}, {
key: 'writeServiceWorker',
value: function writeServiceWorker(serviceWorker, compiler) {
var filepath = this.workerOptions.filepath;
var _compiler$outputFileS = compiler.outputFileSystem,
mkdirp = _compiler$outputFileS.mkdirp,
writeFile = _compiler$outputFileS.writeFile;
// use the outputFileSystem api to manually write service workers rather than adding to the compilation assets
return new Promise(function (resolve) {
mkdirp(_path2.default.resolve(filepath, '..'), function () {
writeFile(filepath, serviceWorker, resolve);
});
});
}
/**
* Push plugin warnings to webpack log
* @param {object} compilation - webpack compilation
* @returns {void}
*/
}, {
key: 'checkWarnings',
value: function checkWarnings(compilation) {
if (this.options.filepath) {
// warn about changing filepath
this.warnings.push(new Error(FILEPATH_WARNING));
}
if (this.options.forceDelete) {
// deprecate forceDelete
this.warnings.push(new Error(FORCEDELETE_WARNING));
}
if (this.workerOptions.debug) {
this.warnings.forEach(function (warning) {
return compilation.warnings.push(warning);
});
}
}
}, {
key: 'workerOptions',
get: function get() {
return _extends({}, this.config, this.options, this.overrides);
}
}]);
return SWPrecacheWebpackPlugin;
}();
module.exports = SWPrecacheWebpackPlugin;

View File

@@ -0,0 +1,109 @@
{
"_args": [
[
"sw-precache-webpack-plugin@0.11.4",
"C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project"
]
],
"_from": "sw-precache-webpack-plugin@0.11.4",
"_id": "sw-precache-webpack-plugin@0.11.4",
"_inBundle": false,
"_integrity": "sha1-ppUBflTu1XVVFJOlGdwdqNotxeA=",
"_location": "/react-scripts/sw-precache-webpack-plugin",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "sw-precache-webpack-plugin@0.11.4",
"name": "sw-precache-webpack-plugin",
"escapedName": "sw-precache-webpack-plugin",
"rawSpec": "0.11.4",
"saveSpec": null,
"fetchSpec": "0.11.4"
},
"_requiredBy": [
"/react-scripts"
],
"_resolved": "https://registry.npmjs.org/sw-precache-webpack-plugin/-/sw-precache-webpack-plugin-0.11.4.tgz",
"_spec": "0.11.4",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project",
"author": {
"name": "Will Farley",
"email": "a.will.farley@gmail.com",
"url": "http://www.willfarley.org/"
},
"ava": {
"babel": "inherit",
"require": [
"babel-register",
"babel-polyfill"
]
},
"bugs": {
"url": "https://github.com/goldhand/sw-precache-webpack-plugin/issues"
},
"dependencies": {
"del": "^2.2.2",
"sw-precache": "^5.1.1",
"uglify-js": "^3.0.13"
},
"description": "Webpack plugin for using service workers",
"devDependencies": {
"ava": "^0.18.2",
"babel-cli": "^6.16.0",
"babel-eslint": "^7.1.1",
"babel-polyfill": "^6.23.0",
"babel-preset-latest": "^6.22.0",
"babel-preset-stage-0": "^6.22.0",
"babel-register": "^6.23.0",
"bluebird": "^3.4.7",
"eslint": "^3.16.1",
"git-release-notes": "1.0.0",
"mkdirp": "^0.5.1",
"sinon": "^1.17.7",
"webpack": "^3.0.0"
},
"directories": {
"example": "./examples",
"lib": "./src",
"test": "./test"
},
"engines": {
"node": ">=4.0.0"
},
"homepage": "https://github.com/goldhand/sw-precache-webpack-plugin#readme",
"keywords": [
"webpack",
"plugin",
"precache",
"sw-precache",
"service",
"worker"
],
"license": "ISC",
"main": "lib/index.js",
"name": "sw-precache-webpack-plugin",
"peerDependencies": {
"webpack": "^1 || ^2 || ^2.1.0-beta || ^2.2.0-beta || ^3"
},
"repository": {
"type": "git",
"url": "git+https://github.com/goldhand/sw-precache-webpack-plugin.git"
},
"scripts": {
"prepublish": "make build",
"test": "make test",
"test:integration": "make integration_test",
"test:unit": "make unit_test",
"version": "make changelog && git add -p CHANGELOG.md && git checkout CHANGELOG.md"
},
"tags": [
"webpack",
"plugin",
"precache",
"sw-precache",
"service",
"worker"
],
"version": "0.11.4"
}

File diff suppressed because it is too large Load Diff