mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-15 12:47:56 +08:00
* chore: update dependencies * fix babel plugins and lint errors * switch out obselete browser plugin * add babel config for jest * revert some babel/jest package bumps * npm install * tmp remove werkzeug pin --------- Co-authored-by: Seve Badajoz <severiano.badajoz@chanzuckerberg.com>
70 lines
1.6 KiB
JavaScript
70 lines
1.6 KiB
JavaScript
const path = require("path");
|
|
const fs = require("fs");
|
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
const ObsoleteWebpackPlugin = require("webpack-obsolete-plugin");
|
|
|
|
const src = path.resolve("src");
|
|
const nodeModules = path.resolve("node_modules");
|
|
|
|
const publicPath = "";
|
|
|
|
const rawObsoleteHTMLTemplate = fs.readFileSync(
|
|
`${__dirname}/obsoleteHTMLTemplate.html`,
|
|
"utf8"
|
|
);
|
|
|
|
const obsoleteHTMLTemplate = rawObsoleteHTMLTemplate.replace(/'/g, '"');
|
|
|
|
module.exports = {
|
|
entry: [
|
|
"core-js",
|
|
"regenerator-runtime/runtime",
|
|
"whatwg-fetch",
|
|
"abort-controller/polyfill",
|
|
"./src/index",
|
|
],
|
|
output: {
|
|
path: path.resolve("build"),
|
|
publicPath,
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.css$/,
|
|
include: src,
|
|
exclude: [path.resolve(src, "index.css")],
|
|
use: [
|
|
MiniCssExtractPlugin.loader,
|
|
{
|
|
loader: "css-loader",
|
|
options: {
|
|
modules: {
|
|
localIdentName: "[name]__[local]___[contenthash:base64:5]",
|
|
},
|
|
importLoaders: 1,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
test: /index\.css$/,
|
|
include: [path.resolve(src, "index.css")],
|
|
use: [MiniCssExtractPlugin.loader, "css-loader"],
|
|
},
|
|
{
|
|
test: /\.json$/,
|
|
include: [src, nodeModules],
|
|
loader: "json-loader",
|
|
exclude: /manifest.json$/,
|
|
},
|
|
],
|
|
},
|
|
plugins: [
|
|
new ObsoleteWebpackPlugin({
|
|
name: "obsolete",
|
|
template: obsoleteHTMLTemplate,
|
|
promptOnNonTargetBrowser: false,
|
|
}),
|
|
],
|
|
};
|