mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-15 12:47:56 +08:00
* update to webpack 5 * update babel * update eslint * update cheerio * update npm min to v7 * revert engine change * generate package lock with npm v6 (lockfileVersion 1) * add region to test setup * update blueprint popover2 * tabindex changes due to blueprint popover2 revision * update snapshots * update lodash and pako * fix typo * fix lodash refactoring * more lodash refactoring * update babel and blueprintjs * update jest support packages * update puppeteer * update regl * update react-icons and react-helmet * update react and react-dom
75 lines
1.8 KiB
JavaScript
75 lines
1.8 KiB
JavaScript
const path = require("path");
|
|
const fs = require("fs");
|
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
const ObsoleteWebpackPlugin = require("obsolete-webpack-plugin");
|
|
const ScriptExtHtmlWebpackPlugin = require("script-ext-html-webpack-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",
|
|
"fastestsmallesttextencoderdecoder",
|
|
"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,
|
|
}),
|
|
new ScriptExtHtmlWebpackPlugin({
|
|
async: "obsolete",
|
|
}),
|
|
],
|
|
};
|