Skip to content

Commit 7756868

Browse files
committed
import labkey/dev.config in jbrowse/dev.config
1 parent 3c3679c commit 7756868

File tree

1 file changed

+16
-38
lines changed

1 file changed

+16
-38
lines changed

jbrowse/dev.config.js

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,29 @@
44
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
55
*/
66
// COPY THIS FILE TO node_modules/@labkey/build/webpack/dev.config.js
7-
const lkModule = process.env.LK_MODULE;
7+
8+
const devConfig = require('./node_modules/@labkey/build/webpack/dev.config')
9+
810
const entryPoints = require('./src/client/entryPoints');
911
const constants = require('./node_modules/@labkey/build/webpack/constants');
1012
const webpack = require('webpack');
1113
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin")
1214

13-
// set based on the lk module calling this config
14-
__dirname = lkModule;
15-
16-
const clientConfig = {
17-
18-
context: constants.context(__dirname),
19-
20-
mode: 'development',
15+
const clientConfig = devConfig
2116

22-
devtool: 'eval',
23-
24-
entry: constants.processEntries(entryPoints),
25-
26-
output: {
27-
path: constants.outputPath(__dirname),
28-
publicPath: './', // allows context path to resolve in both js/css
29-
filename: '[name].js'
30-
},
31-
32-
module: {
33-
rules: constants.loaders.TYPESCRIPT.concat(constants.loaders.STYLE).concat(constants.loaders.FILES),
34-
},
17+
clientConfig.resolve.fallback =
18+
{
19+
"buffer": require.resolve("buffer"),
20+
"path": require.resolve("path-browserify"),
21+
"stream": require.resolve("stream-browserify"),
22+
"zlib": require.resolve("browserify-zlib"),
23+
"vm": require.resolve("vm-browserify"),
24+
"fs": false
25+
}
3526

36-
resolve: {
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-
}
47-
},
27+
clientConfig.plugins =
28+
[new webpack.ProvidePlugin({regeneratorRuntime: 'regenerator-runtime'}),
29+
new NodePolyfillPlugin()].concat(constants.processPlugins(entryPoints))
4830

49-
plugins: [new webpack.ProvidePlugin({
50-
regeneratorRuntime: 'regenerator-runtime'
51-
}), new NodePolyfillPlugin()].concat(constants.processPlugins(entryPoints)),
52-
}
5331

5432
module.exports = [clientConfig]

0 commit comments

Comments
 (0)