Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update webpack.config.js to webpack 5 and use latest @jbrowse/react-linear-genome-view #20

Merged
merged 6 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update webpack.config.js to webpack 5 and use latest tools
  • Loading branch information
cmdcolin committed Jun 2, 2023
commit 8df8fba3f7cf91d48b2f323b654f540df382721b
188 changes: 2 additions & 186 deletions inst/htmlwidgets/JBrowseR.js

Large diffs are not rendered by default.

188 changes: 188 additions & 0 deletions inst/htmlwidgets/JBrowseR.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/

/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/

/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/

/*!
* escape-html
* Copyright(c) 2012-2013 TJ Holowaychuk
* Copyright(c) 2015 Andreas Lubbe
* Copyright(c) 2015 Tiancheng "Timothy" Gu
* MIT Licensed
*/

/*!
* get-value <https://github.com/jonschlinkert/get-value>
*
* Copyright (c) 2014-2018, Jon Schlinkert.
* Released under the MIT License.
*/

/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/

/*!
* is-primitive <https://github.com/jonschlinkert/is-primitive>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*/

/*!
* isobject <https://github.com/jonschlinkert/isobject>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/

/*!
* set-value <https://github.com/jonschlinkert/set-value>
*
* Copyright (c) Jon Schlinkert (https://github.com/jonschlinkert).
* Released under the MIT License.
*/

/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

/*! @license DOMPurify 3.0.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.3/LICENSE */

/*! https://mths.be/punycode v1.3.2 by @mathias */

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */

/*! load-script2. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */

/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */

/*!!
* Canvas 2 Svg v1.0.15
* A low level canvas to SVG converter. Uses a mock canvas context to build an SVG document.
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Author:
* Kerry Liu
*
* Copyright (c) 2014 Gliffy Inc.
*/

/**
* @license
* Copyright 2009 The Closure Library Authors
* Copyright 2020 Daniel Wirtz / The long.js Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/

/**
* @mui/material v5.13.3
*
* @license MIT
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @mui/styled-engine v5.13.2
*
* @license MIT
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @mui/x-data-grid v6.6.0
*
* @license MIT
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/

/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.2
* react-dom-server.browser.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.2
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
20 changes: 12 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
{
"private": true,
"scripts": {
"build": "webpack"
},
"dependencies": {
"@jbrowse/react-linear-genome-view": "^2.0.1",
"@jbrowse/react-linear-genome-view": "^2.5.0",
"node-polyfill-webpack-plugin": "^2.0.1",
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"devDependencies": {
"@babel/core": "^7.2.0",
"@babel/core": "^7.22.1",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.2.0",
"@babel/preset-react": "^7.0.0",
"babel-loader": "^8.0.4",
"compression-webpack-plugin": "^6.0.0",
"webpack": "^4.27.1",
"webpack-cli": "^3.1.2"
"@babel/preset-env": "^7.22.4",
"@babel/preset-react": "^7.22.3",
"babel-loader": "^9.1.2",
"compression-webpack-plugin": "^10.0.0",
"webpack": "^5.85.0",
"webpack-cli": "^5.1.1"
}
}
85 changes: 39 additions & 46 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,43 @@
var path = require('path');
var CompressionPlugin = require("compression-webpack-plugin");
var webpack = require('webpack')
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
const path = require("path");
const webpack = require("webpack");

module.exports = {
mode: 'production',
entry: ['@babel/polyfill', path.join(__dirname, 'srcjs', 'JBrowseR.jsx')],
output: {
path: path.join(__dirname, 'inst/htmlwidgets'),
filename: 'JBrowseR.js'
},
module: {
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react']
}
}
]
},
resolve: {
extensions: ['.js', '.jsx'],
},
externals: {
'react': 'window.React',
'react-dom': 'window.ReactDOM',
'reactR': 'window.reactR'
},
node: {
fs: 'empty'
},
stats: {
colors: true
},
plugins: [
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1,
}),
mode: "production",
entry: ["@babel/polyfill", path.join(__dirname, "srcjs", "JBrowseR.jsx")],
output: {
path: path.join(__dirname, "inst/htmlwidgets"),
filename: "JBrowseR.js",
},
module: {
rules: [
{
test: /\.jsx?$/,
loader: "babel-loader",
options: {
presets: ["@babel/preset-env", "@babel/preset-react"],
},
},
],
// can toggle source map back on during development
// devtool: 'source-map'
devtool: '',
// This makes the bundle go from 2.88 MB -> 984 KB
// but currently breaks htmlwidgets
// plugins: [new CompressionPlugin({
// deleteOriginalAssets: true
// })],
},
resolve: {
extensions: [".js", ".jsx"],
},
externals: {
react: "window.React",
"react-dom": "window.ReactDOM",
reactR: "window.reactR",
},

stats: {
colors: true,
},
plugins: [
new NodePolyfillPlugin({
excludeAliases: ["console"],
}),
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1,
}),
],
};
Loading