Skip to content

Commit 7e8d3b3

Browse files
Siwei Zhangmarcdumais-work
authored andcommitted
Add webpack.config.js to docker example
Some views like statistics view have features to right-click on the entries and select time ranges, but this feature requires some Node.js-specific features like "process", which is missing for the docker example. Fixes #1066 Signed-off-by: Siwei Zhang <[email protected]>
1 parent dee7c56 commit 7e8d3b3

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

docker/theia-trace-extension/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ RUN apt-get update && apt-get install -y \
1212

1313
# Build the browser theia-trace-extension application
1414
COPY example-package.json /app/tte/package.json
15+
COPY webpack.config.js /app/tte/webpack.config.js
1516
WORKDIR /app/tte/
1617
RUN yarn && \
1718
npx theia build --app-target=\"browser\" --mode production && \
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* This file can be edited to customize webpack configuration.
3+
* To reset delete this file and rerun theia build again.
4+
*/
5+
// @ts-check
6+
const config = require('./gen-webpack.config.js');
7+
const webpack = require("webpack");
8+
9+
10+
/**
11+
* Expose bundled modules on window.theia.moduleName namespace, e.g.
12+
* window['theia']['@theia/core/lib/common/uri'].
13+
* Such syntax can be used by external code, for instance, for testing.
14+
config.module.rules.push({
15+
test: /\.js$/,
16+
loader: require.resolve('@theia/application-manager/lib/expose-loader')
17+
}); */
18+
19+
config[0].plugins.push(new webpack.DefinePlugin({
20+
'process.env': {
21+
NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development')
22+
}
23+
}));
24+
25+
module.exports = config;

0 commit comments

Comments
 (0)