Archived
1
0

Externalize spdlog .node module

This commit is contained in:
Kyle Carberry
2019-02-21 19:32:08 -06:00
parent 670003c3c9
commit 73d6b77614
9 changed files with 38 additions and 35 deletions

View File

@ -83,7 +83,23 @@ module.exports = (options = {}) => ({
}, {
test: /\.wasm$/,
type: "javascript/auto",
}],
}, {
/**
* Fixes spdlog
*/
test: /spdlog\/index\.js/,
loader: "string-replace-loader",
options: {
multiple: [{
// These will be handled by file-loader. We need the location because
// they are parsed as URIs and will throw errors if not fully formed.
// The !! prefix causes it to ignore other loaders (doesn't work).
search: "const spdlog.*;",
replace: "const spdlog = __non_webpack_require__(global.SPDLOG_LOCATION);",
flags: "g",
}],
},
},],
noParse: /\/test\/|\.test\.jsx?|\.test\.tsx?|tsconfig.+\.json$/,
},
resolve: {