-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #269
- Loading branch information
Showing
38 changed files
with
941 additions
and
992 deletions.
There are no files selected for viewing
127 changes: 127 additions & 0 deletions
127
open-bpmn.glsp-client/open-bpmn-app/gen-webpack.node.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
/** | ||
* Don't touch this file. It will be regenerated by theia build. | ||
* To customize webpack configuration change /home/rsoika/git/open-bpmn/open-bpmn.glsp-client/open-bpmn-app/webpack.config.js | ||
*/ | ||
// @ts-check | ||
const path = require('path'); | ||
const yargs = require('yargs'); | ||
const webpack = require('webpack'); | ||
const TerserPlugin = require('terser-webpack-plugin'); | ||
const NativeWebpackPlugin = require('@theia/native-webpack-plugin'); | ||
|
||
const { mode } = yargs.option('mode', { | ||
description: "Mode to use", | ||
choices: ["development", "production"], | ||
default: "production" | ||
}).argv; | ||
|
||
const production = mode === 'production'; | ||
|
||
/** @type {import('webpack').EntryObject} */ | ||
const commonJsLibraries = {}; | ||
for (const [entryPointName, entryPointPath] of Object.entries({ | ||
|
||
'nsfw-watcher': '@theia/filesystem/lib/node/nsfw-watcher', | ||
|
||
})) { | ||
commonJsLibraries[entryPointName] = { | ||
import: require.resolve(entryPointPath), | ||
library: { | ||
type: 'commonjs2', | ||
}, | ||
}; | ||
} | ||
|
||
const ignoredResources = new Set(); | ||
|
||
if (process.platform !== 'win32') { | ||
ignoredResources.add('@vscode/windows-ca-certs'); | ||
} | ||
|
||
const nativePlugin = new NativeWebpackPlugin({ | ||
out: 'native', | ||
ripgrep: false, | ||
pty: true, | ||
nativeBindings: { | ||
drivelist: 'drivelist/build/Release/drivelist.node' | ||
} | ||
}); | ||
|
||
/** @type {import('webpack').Configuration} */ | ||
const config = { | ||
mode, | ||
devtool: mode === 'development' ? 'source-map' : false, | ||
target: 'node', | ||
node: { | ||
global: false, | ||
__filename: false, | ||
__dirname: false | ||
}, | ||
output: { | ||
filename: '[name].js', | ||
path: path.resolve(__dirname, 'lib', 'backend'), | ||
devtoolModuleFilenameTemplate: 'webpack:///[absolute-resource-path]?[loaders]', | ||
}, | ||
entry: { | ||
// Main entry point of the Theia application backend: | ||
'main': require.resolve('./src-gen/backend/main'), | ||
// Theia's IPC mechanism: | ||
'ipc-bootstrap': require.resolve('@theia/core/lib/node/messaging/ipc-bootstrap'), | ||
|
||
// Make sure the node-pty thread worker can be executed: | ||
'worker/conoutSocketWorker': require.resolve('node-pty/lib/worker/conoutSocketWorker'), | ||
|
||
|
||
...commonJsLibraries | ||
}, | ||
module: { | ||
rules: [ | ||
// Make sure we can still find and load our native addons. | ||
{ | ||
test: /\.node$/, | ||
loader: 'node-loader', | ||
options: { | ||
name: 'native/[name].[ext]' | ||
} | ||
}, | ||
{ | ||
test: /\.js$/, | ||
enforce: 'pre', | ||
loader: 'source-map-loader' | ||
}, | ||
// jsonc-parser exposes its UMD implementation by default, which | ||
// confuses Webpack leading to missing js in the bundles. | ||
{ | ||
test: /node_modules[\/](jsonc-parser)/, | ||
loader: 'umd-compat-loader' | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
// Some native dependencies (bindings, @vscode/ripgrep) need special code replacements | ||
nativePlugin, | ||
// Optional node dependencies can be safely ignored | ||
new webpack.IgnorePlugin({ | ||
checkResource: resource => ignoredResources.has(resource) | ||
}) | ||
], | ||
optimization: { | ||
// Split and reuse code across the various entry points | ||
splitChunks: { | ||
chunks: 'all' | ||
}, | ||
// Only minimize if we run webpack in production mode | ||
minimize: production, | ||
minimizer: [ | ||
new TerserPlugin({ | ||
exclude: /^(lib|builtins)\// | ||
}) | ||
] | ||
}, | ||
}; | ||
|
||
module.exports = { | ||
config, | ||
nativePlugin, | ||
ignoredResources | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.