mirror of
https://github.com/coder/code-server.git
synced 2025-07-30 05:22:04 +08:00
Create initial server layout (#11)
* Create initial server layout * Adjust command name to entry * Add @oclif/config as dependency * Implement build process for outputting single binary * Add init message * Remove unused import, add tsconfig.json to .gitignore * Accidently pushed wacky change to output host FS files * Add options to createApp
This commit is contained in:
48
packages/server/webpack.config.js
Normal file
48
packages/server/webpack.config.js
Normal file
@ -0,0 +1,48 @@
|
||||
const path = require("path");
|
||||
const webpack = require("webpack");
|
||||
const merge = require("webpack-merge");
|
||||
const StringReplacePlugin = require("string-replace-webpack-plugin");
|
||||
|
||||
module.exports = merge({
|
||||
devtool: 'none',
|
||||
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: () => / /,
|
||||
}
|
||||
]
|
||||
}),
|
||||
},
|
||||
],
|
||||
},
|
||||
output: {
|
||||
filename: "cli.js",
|
||||
path: path.join(__dirname, "./out"),
|
||||
libraryTarget: "commonjs",
|
||||
},
|
||||
node: {
|
||||
console: false,
|
||||
global: false,
|
||||
process: false,
|
||||
Buffer: false,
|
||||
__filename: false,
|
||||
__dirname: false,
|
||||
setImmediate: false
|
||||
},
|
||||
externals: ["node-pty"],
|
||||
entry: "./packages/server/src/cli.ts",
|
||||
target: "node",
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
"process.env.BUILD_DIR": `"${__dirname}"`,
|
||||
}),
|
||||
],
|
||||
}, require("../../scripts/webpack.general.config"), {
|
||||
mode: "development",
|
||||
});
|
Reference in New Issue
Block a user