You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
413 B
13 lines
413 B
7 years ago
|
var path = require('path');
|
||
|
|
||
|
// based on: https://github.com/webpack-contrib/node-loader/blob/master/index.js
|
||
|
module.exports = function nodeLoader(m, q) {
|
||
|
return (`
|
||
|
var modulePath = __dirname + '/${path.basename(this.resourcePath)}';
|
||
|
try {
|
||
|
global.process.dlopen(module, modulePath);
|
||
|
} catch(e) {
|
||
|
throw new Error('dlopen: Cannot open ' + modulePath + ': ' + e);
|
||
|
}
|
||
|
`);
|
||
|
}
|