Socket
Socket
Sign inDemoInstall

native-ext-loader

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

native-ext-loader - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

tmp/webpack-demos/demo01/bundle.js

12

CHANGELOG.md

@@ -0,10 +1,14 @@

# 2.1.0
- Handle the relative "current directory" path when using `rewritePath`
# 2.0.0
* Remove `loader-utils` dependency. (5156da688769f861cf657ee5f7087310f7ec6819)
* Remove configurable `name` option. (5156da688769f861cf657ee5f7087310f7ec6819)
* Assume that custom options are a valid hash object. (5156da688769f861cf657ee5f7087310f7ec6819)
- Remove `loader-utils` dependency. (5156da688769f861cf657ee5f7087310f7ec6819)
- Remove configurable `name` option. (5156da688769f861cf657ee5f7087310f7ec6819)
- Assume that custom options are a valid hash object. (5156da688769f861cf657ee5f7087310f7ec6819)
# 1.1.0
* Add a support for Webpack 4.0.x. (#1 by @matsnow)
- Add a support for Webpack 4.0.x. (#1 by @matsnow)

@@ -11,0 +15,0 @@ # 1.0.0

var path = require("path");
module.exports = function (content) {
module.exports = function(content) {
const defaultConfig = {

@@ -15,15 +15,31 @@ rewritePath: undefined

} else {
throw new Error('emitFile function is not available');
throw new Error("emitFile function is not available");
}
if (config.rewritePath) {
const filePath = JSON.stringify(path.join(config.rewritePath, fileName));
let filePath;
return "try { global.process.dlopen(module, " + filePath + "); } " +
"catch(exception) { throw new Error('Cannot open ' + " + filePath + " + ': ' + exception); };";
if (config.rewritePath === "./" || config.rewritePath === ".\\") {
filePath = JSON.stringify(config.rewritePath + fileName);
} else {
filePath = JSON.stringify(path.join(config.rewritePath, fileName));
}
return (
"try { global.process.dlopen(module, " +
filePath +
"); } " +
"catch(exception) { throw new Error('Cannot open ' + " +
filePath +
" + ': ' + exception); };"
);
} else {
return "const path = require('path');" +
"const filePath = path.resolve(__dirname, " + JSON.stringify(fileName) + ");" +
return (
"const path = require('path');" +
"const filePath = path.resolve(__dirname, " +
JSON.stringify(fileName) +
");" +
"try { global.process.dlopen(module, filePath); } " +
"catch(exception) { throw new Error('Cannot open ' + filePath + ': ' + exception); };";
"catch(exception) { throw new Error('Cannot open ' + filePath + ': ' + exception); };"
);
}

@@ -30,0 +46,0 @@ };

@@ -17,3 +17,3 @@ {

"scripts": {},
"version": "2.0.0"
"version": "2.1.0"
}

@@ -21,8 +21,10 @@ # Node Native Loader

```javascript
```js
module: {
rules: [
test: /\.node$/,
loader: 'native-ext-loader'
]
{
test: /\.node$/,
loader: "native-ext-loader"
}
];
}

@@ -35,11 +37,13 @@ ```

```javascript
```js
module: {
rules: [
test: /\.node$/,
loader: 'native-ext-loader',
options: {
rewritePath: path.resolve(__dirname, 'dist')
{
test: /\.node$/,
loader: "native-ext-loader",
options: {
rewritePath: path.resolve(__dirname, "dist")
}
}
]
];
}

@@ -53,1 +57,10 @@ ```

Note that it needs to remain `undefined` if you are building a package with embedded files. This way, the compiled application will work no matter of its location. This is important when building Electron applications that can be placed in any directory by the end user.
## Releasing a new version
1. Bump version number in the `package.json` and `CHANGELOG.md` files.
1. Run `npm install` to update `package-lock.json` file.
1. Commit changes (include changes)
1. Add a new tag (use `-a` and include changes)
1. Push commits and tag
1. Run `npm publish`
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc