From d9b11a73c12824cb7595bb695b0c32dc173b231c Mon Sep 17 00:00:00 2001 From: Michael Ciniawsky Date: Tue, 21 Feb 2017 01:39:12 +0100 Subject: [PATCH 1/3] docs(README): refactor for webpack v2 --- README.md | 87 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 78 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6c18235..f48d6d0 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,85 @@ -# script loader for webpack +[![npm][npm]][npm-url] +[![node][node]][node-url] +[![deps][deps]][deps-url] +[![tests][tests]][tests-url] +[![coverage][cover]][cover-url] +[![chat][chat]][chat-url] -## Usage +
+ + + +

Script Loader

+
-``` javascript -require("script-loader!./file.js"); -// => execute file.js once in global context +

Install

+ +```bash +npm install --save-dev script-loader +``` + +

Usage

+ +Executes JS script once in global context. + +> :wanring: Doesn't work in NodeJS + +### Config (recommended) + +```js +import exec from 'script.exec.js'; +``` + +**webpack.config.js** +```js +module.exports = { + module: { + rules: [ + { + test: /\.exec.js$/, + use: [ 'script-loader' ] + } + ] + } +} ``` -[Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html) +### Inline + +```js +import exec from 'script-loader!./script.js'; +``` + +

Maintainer

+ + + + + + + +
+ +
+ Tobias Koppers +
+ + +[npm]: https://img.shields.io/npm/v/script-loader.svg +[npm-url]: https://npmjs.com/package/script-loader + +[node]: https://img.shields.io/node/v/script-loader.svg +[node-url]: https://nodejs.org + +[deps]: https://david-dm.org/webpack/script-loader.svg +[deps-url]: https://david-dm.org/webpack/script-loader -Does nothing in node.js. +[tests]: http://img.shields.io/travis/webpack/script-loader.svg +[tests-url]: https://travis-ci.org/webpack/script-loader -## License +[cover]: https://coveralls.io/repos/github/webpack/script-loader/badge.svg +[cover-url]: https://coveralls.io/github/webpack/script-loader -MIT (http://www.opensource.org/licenses/mit-license.php) +[chat]: https://badges.gitter.im/webpack/webpack.svg +[chat-url]: https://gitter.im/webpack/webpack From 9d614cce2a2f0bd0579f735fa3b160a42382f146 Mon Sep 17 00:00:00 2001 From: Michael Ciniawsky Date: Tue, 21 Feb 2017 01:39:46 +0100 Subject: [PATCH 2/3] docs(LICENSE): add JSF License --- LICENSE | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8c11fc7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +Copyright JS Foundation and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From 5b9d5900e66162d56923ffdf3c25d9bc15385a68 Mon Sep 17 00:00:00 2001 From: Michael Ciniawsky Date: Tue, 21 Feb 2017 01:44:08 +0100 Subject: [PATCH 3/3] docs(README): fix typo in warning --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f48d6d0..18639a3 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ npm install --save-dev script-loader Executes JS script once in global context. -> :wanring: Doesn't work in NodeJS +> :warning: Doesn't work in NodeJS ### Config (recommended)