Skip to content

Commit 81ec41f

Browse files
committed
import watch and prod config to from jbrowse, add fallbacks and plugins
1 parent 7756868 commit 81ec41f

File tree

4 files changed

+64
-3
lines changed

4 files changed

+64
-3
lines changed

jbrowse/dev.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*
44
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
55
*/
6-
// COPY THIS FILE TO node_modules/@labkey/build/webpack/dev.config.js
76

87
const devConfig = require('./node_modules/@labkey/build/webpack/dev.config')
98

jbrowse/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"scripts": {
66
"setup": "npm ci",
77
"build": "npm run build-dev",
8-
"start": "cross-env NODE_ENV=development LK_MODULE_CONTAINER=DiscvrLabKeyModules LK_MODULE=jbrowse webpack-dev-server --config node_modules/@labkey/build/webpack/watch.config.js",
8+
"start": "cross-env NODE_ENV=development LK_MODULE_CONTAINER=DiscvrLabKeyModules LK_MODULE=jbrowse webpack-dev-server --config watch.config.js",
99
"build-dev": "npm run clean && cross-env NODE_ENV=development LK_MODULE_CONTAINER=DiscvrLabKeyModules LK_MODULE=jbrowse webpack --config dev.config.js --progress --profile",
10-
"build-prod": "npm run clean && cross-env NODE_ENV=production PROD_SOURCE_MAP=source-map LK_MODULE_CONTAINER=DiscvrLabKeyModules LK_MODULE=jbrowse webpack --config node_modules/@labkey/build/webpack/prod.config.js --progress --profile --colors",
10+
"build-prod": "npm run clean && cross-env NODE_ENV=production PROD_SOURCE_MAP=source-map LK_MODULE_CONTAINER=DiscvrLabKeyModules LK_MODULE=jbrowse webpack --config prod.config.js --progress --profile --colors",
1111
"clean": "rimraf resources/web/jbrowse/gen && rimraf resources/views/gen && rimraf resources/views/browser*",
1212
"test": "cross-env NODE_ENV=test jest"
1313
},

jbrowse/prod.config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2019 LabKey Corporation
3+
*
4+
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
5+
*/
6+
7+
const prodConfig = require('./node_modules/@labkey/build/webpack/prod.config')
8+
9+
const entryPoints = require('./src/client/entryPoints');
10+
const constants = require('./node_modules/@labkey/build/webpack/constants');
11+
const webpack = require('webpack');
12+
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin")
13+
14+
const clientConfig = prodConfig
15+
16+
clientConfig.resolve.fallback =
17+
{
18+
"buffer": require.resolve("buffer"),
19+
"path": require.resolve("path-browserify"),
20+
"stream": require.resolve("stream-browserify"),
21+
"zlib": require.resolve("browserify-zlib"),
22+
"vm": require.resolve("vm-browserify"),
23+
"fs": false
24+
}
25+
26+
clientConfig.plugins =
27+
[new webpack.ProvidePlugin({regeneratorRuntime: 'regenerator-runtime'}),
28+
new NodePolyfillPlugin()].concat(constants.processPlugins(entryPoints))
29+
30+
31+
module.exports = [clientConfig]

jbrowse/watch.config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2019 LabKey Corporation
3+
*
4+
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
5+
*/
6+
7+
const watchConfig = require('./node_modules/@labkey/build/webpack/watch.config')
8+
9+
const entryPoints = require('./src/client/entryPoints');
10+
const constants = require('./node_modules/@labkey/build/webpack/constants');
11+
const webpack = require('webpack');
12+
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin")
13+
14+
const clientConfig = watchConfig
15+
16+
clientConfig.resolve.fallback =
17+
{
18+
"buffer": require.resolve("buffer"),
19+
"path": require.resolve("path-browserify"),
20+
"stream": require.resolve("stream-browserify"),
21+
"zlib": require.resolve("browserify-zlib"),
22+
"vm": require.resolve("vm-browserify"),
23+
"fs": false
24+
}
25+
26+
clientConfig.plugins =
27+
[new webpack.ProvidePlugin({regeneratorRuntime: 'regenerator-runtime'}),
28+
new NodePolyfillPlugin()].concat(constants.processPlugins(entryPoints))
29+
30+
31+
module.exports = [clientConfig]

0 commit comments

Comments
 (0)