Skip to content

Commit 495b84b

Browse files
committed
initial jbrowse2 implementation in 2.1.0
1 parent 7502788 commit 495b84b

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

jbrowse/dev.config.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
*
44
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
55
*/
6-
76
// COPY THIS FILE TO node_modules/@labkey/build/webpack/dev.config.js
87
const lkModule = process.env.LK_MODULE;
98
const entryPoints = require('../../../../src/client/entryPoints');
109
const constants = require('./constants');
1110
const webpack = require('webpack');
11+
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin")
1212

1313
// set based on the lk module calling this config
1414
__dirname = lkModule;
1515

16-
module.exports = {
16+
const clientConfig = {
17+
1718
context: constants.context(__dirname),
1819

1920
mode: 'development',
@@ -29,18 +30,27 @@ module.exports = {
2930
},
3031

3132
module: {
32-
rules: constants.loaders.TYPESCRIPT_LOADERS.concat(constants.loaders.STYLE_LOADERS)
33+
rules: constants.loaders.TYPESCRIPT.concat(constants.loaders.STYLE).concat(constants.loaders.FILES),
3334
},
3435

3536
resolve: {
36-
extensions: constants.extensions.TYPESCRIPT
37+
alias: constants.aliases.LABKEY_PACKAGES,
38+
extensions: constants.extensions.TYPESCRIPT,
39+
fallback: {
40+
"buffer": require.resolve("buffer"),
41+
"path": require.resolve("path-browserify"),
42+
"stream": require.resolve("stream-browserify"),
43+
"zlib": require.resolve("browserify-zlib"),
44+
"vm": require.resolve("vm-browserify"),
45+
"fs": false
46+
}
3747
},
3848

3949
plugins: [new webpack.ProvidePlugin({
4050
regeneratorRuntime: 'regenerator-runtime',
41-
})],
42-
43-
node: {
44-
fs: "empty"
45-
},
51+
}), new NodePolyfillPlugin()],
4652
};
53+
54+
55+
56+
module.exports = [clientConfig]

jbrowse/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
"@jbrowse/react-linear-genome-view": "^1.1.0",
1616
"@labkey/components": "2.14.0",
1717
"regenerator-runtime": "^0.13.7",
18-
"typescript": "^3.5.2"
18+
"typescript": "^3.5.2",
19+
"node-polyfill-webpack-plugin": "1.1.0",
20+
"node-loader": ""
1921
},
2022
"devDependencies": {
21-
"@labkey/build": "0.5.0",
23+
"@labkey/build": "2.1.0",
2224
"@types/enzyme": "3.10.7",
2325
"@types/jest": "26.0.14",
2426
"@types/react": "16.9.51",

0 commit comments

Comments
 (0)