script-loader
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -6,6 +6,13 @@ /* | ||
module.exports = function(src) { | ||
if (typeof execScript !== "undefined") | ||
execScript(src); | ||
else | ||
eval.call(null, src); | ||
try { | ||
if (typeof eval !== "undefined") { | ||
eval.call(null, src); | ||
} else if (typeof execScript !== "undefined") { | ||
execScript(src); | ||
} else { | ||
console.error("[Script Loader] EvalError: No eval function available"); | ||
} | ||
} catch (error) { | ||
console.error("[Script Loader] ", error.message); | ||
} | ||
} |
@@ -0,0 +0,0 @@ /* |
{ | ||
"name": "script-loader", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"author": "Tobias Koppers @sokra", | ||
"description": "script loader module for webpack", | ||
"license": "MIT", | ||
"scripts": { | ||
"release": "standard-version" | ||
}, | ||
"dependencies": { | ||
"raw-loader": "~0.5.1" | ||
}, | ||
"devDependencies": { | ||
"standard-version": "^4.2.0" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:webpack/script-loader.git" | ||
"url": "https://github.com/webpack-contrib/script-loader.git" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "http://www.opensource.org/licenses/mit-license.php" | ||
} | ||
] | ||
"bugs": { | ||
"url": "https://github.com/webpack/script-loader/issues" | ||
}, | ||
"homepage": "https://github.com/webpack/script-loader" | ||
} |
@@ -1,16 +0,96 @@ | ||
# script loader for webpack | ||
[![npm][npm]][npm-url] | ||
[![node][node]][node-url] | ||
[![deps][deps]][deps-url] | ||
[![chat][chat]][chat-url] | ||
## Usage | ||
<div align="center"> | ||
<a href="https://github.com/webpack/webpack"> | ||
<img width="200" height="200" | ||
src="https://webpack.js.org/assets/icon-square-big.svg"> | ||
</a> | ||
<h1>Script Loader</h1> | ||
</div> | ||
``` javascript | ||
require("script!./file.js"); | ||
// => execute file.js once in global context | ||
<h2 align="center">Install</h2> | ||
```bash | ||
npm install --save-dev script-loader | ||
``` | ||
[Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html) | ||
<h2 align="center">Usage</h2> | ||
Does nothing in node.js. | ||
Executes JS script once in global context. | ||
## License | ||
> :warning: Doesn't work in NodeJS | ||
MIT (http://www.opensource.org/licenses/mit-license.php) | ||
### Config (recommended) | ||
```js | ||
import exec from 'script.exec.js'; | ||
``` | ||
**webpack.config.js** | ||
```js | ||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.exec\.js$/, | ||
use: [ 'script-loader' ] | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
### Inline | ||
```js | ||
import exec from 'script-loader!./script.js'; | ||
``` | ||
<h2 align="center">Maintainers</h2> | ||
<table> | ||
<tbody> | ||
<tr> | ||
<td align="center"> | ||
<img width="150" height="150" | ||
src="https://avatars3.githubusercontent.com/u/166921?v=3&s=150"> | ||
</br> | ||
<a href="https://github.com/bebraw">Juho Vepsäläinen</a> | ||
</td> | ||
<td align="center"> | ||
<img width="150" height="150" | ||
src="https://avatars2.githubusercontent.com/u/8420490?v=3&s=150"> | ||
</br> | ||
<a href="https://github.com/d3viant0ne">Joshua Wiens</a> | ||
</td> | ||
<td align="center"> | ||
<img width="150" height="150" | ||
src="https://avatars3.githubusercontent.com/u/533616?v=3&s=150"> | ||
</br> | ||
<a href="https://github.com/SpaceK33z">Kees Kluskens</a> | ||
</td> | ||
<td align="center"> | ||
<img width="150" height="150" | ||
src="https://avatars3.githubusercontent.com/u/3408176?v=3&s=150"> | ||
</br> | ||
<a href="https://github.com/TheLarkInn">Sean Larkin</a> | ||
</td> | ||
</tr> | ||
<tbody> | ||
</table> | ||
[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 | ||
[chat]: https://badges.gitter.im/webpack/webpack.svg | ||
[chat-url]: https://gitter.im/webpack/webpack |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
5720
7
37
1
1
97
1
1