Move string replacements for node-pty to general
This commit is contained in:
@ -1,39 +1,10 @@
|
||||
const path = require("path");
|
||||
const webpack = require("webpack");
|
||||
const merge = require("webpack-merge");
|
||||
const StringReplacePlugin = require("string-replace-webpack-plugin");
|
||||
const HappyPack = require("happypack");
|
||||
|
||||
module.exports = merge({
|
||||
devtool: "none",
|
||||
mode: "development",
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /@oclif\/command\/lib\/index\.js/,
|
||||
loader: StringReplacePlugin.replace({
|
||||
replacements: [
|
||||
{
|
||||
// This is required otherwise it attempts to require("package.json")
|
||||
pattern: /checkNodeVersion\(\)\;/,
|
||||
replacement: () => / /,
|
||||
}
|
||||
]
|
||||
}),
|
||||
},
|
||||
{
|
||||
test: /node\-pty\/lib\/index\.js/,
|
||||
loader: StringReplacePlugin.replace({
|
||||
replacements: [
|
||||
{
|
||||
pattern: /exports\.native.*;/,
|
||||
replacement: () => "exports.native = null;",
|
||||
}
|
||||
]
|
||||
}),
|
||||
},
|
||||
],
|
||||
},
|
||||
output: {
|
||||
filename: "cli.js",
|
||||
path: path.join(__dirname, "./out"),
|
||||
|
Reference in New Issue
Block a user