Skip to content

Commit

Permalink
[build-scripts] upgrade webpack deps, adjust karma stylesheets
Browse files Browse the repository at this point in the history
  • Loading branch information
adidahiya committed Mar 29, 2022
1 parent 3934488 commit eba785b
Show file tree
Hide file tree
Showing 4 changed files with 614 additions and 582 deletions.
17 changes: 16 additions & 1 deletion packages/karma-build-scripts/createKarmaConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright 2017 Palantir Technologies, Inc. All rights reserved.
*/

const fs = require("fs");
const path = require("path");

const webpackBuildScripts = require("@blueprintjs/webpack-build-scripts");
Expand Down Expand Up @@ -45,7 +46,7 @@ module.exports = function createKarmaConfig(
pattern: path.join(dirname, "resources/**/*"),
watched: false,
},
path.join(dirname, `../core/${coreManifest.style}`),
getCoreStylesheetPath(dirname),
path.join(dirname, packageManifest.style),
path.join(dirname, "test/index.ts"),
],
Expand Down Expand Up @@ -121,3 +122,17 @@ module.exports = function createKarmaConfig(

return config;
};

/**
* @param {string} dirname
* @returns string
*/
function getCoreStylesheetPath(dirname) {
const localCorePath = path.join(dirname, "../core");
if (fs.existsSync(localCorePath)) {
return path.join(localCorePath, coreManifest.style);
} else {
// resolves to "**/node_modules/@blueprintjs/core/lib/cjs/index.js"
return path.join(require.resolve("@blueprintjs/core"), "../../../", coreManifest.style);
}
}
34 changes: 17 additions & 17 deletions packages/webpack-build-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@
"test": "exit 0"
},
"dependencies": {
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.0-beta.1",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
"assert": "^2.0.0",
"autoprefixer": "^10.2.4",
"css-loader": "^5.0.1",
"cssnano": "^4.1.10",
"autoprefixer": "^10.4.4",
"css-loader": "^6.7.1",
"cssnano": "^5.1.5",
"file-loader": "^6.2.0",
"fork-ts-checker-notifier-webpack-plugin": "^3.0.0",
"fork-ts-checker-webpack-plugin": "^6.1.0",
"mini-css-extract-plugin": "^1.3.5",
"fork-ts-checker-notifier-webpack-plugin": "^6.0.0",
"fork-ts-checker-webpack-plugin": "^7.2.1",
"mini-css-extract-plugin": "^2.6.0",
"node-sass": "^5.0.0",
"postcss": "^8.2.4",
"postcss-discard-comments": "^4.0.2",
"postcss-loader": "^5.0.0",
"postcss": "^8.4.12",
"postcss-discard-comments": "^5.1.1",
"postcss-loader": "^6.2.1",
"process": "^0.11.10",
"react-refresh": "^0.9.0",
"sass-loader": "^11.0.0",
"source-map-loader": "^2.0.0",
"style-loader": "^2.0.0",
"ts-loader": "^8.0.15",
"react-refresh": "^0.11.0",
"sass-loader": "^12.6.0",
"source-map-loader": "^3.0.1",
"style-loader": "^3.3.1",
"ts-loader": "^9.2.8",
"webpack": "^5.21.0",
"webpack-bundle-analyzer": "^4.4.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-dev-server": "^3.11.0",
"webpack-notifier": "^1.13.0"
"webpack-notifier": "^1.15.0"
},
"repository": {
"type": "git",
Expand Down
7 changes: 3 additions & 4 deletions packages/webpack-build-scripts/webpack.config.karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/

const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
const path = require("path");
const webpack = require("webpack");

/**
Expand All @@ -28,11 +27,11 @@ module.exports = {
rules: [
{
test: /\.js$/,
use: "source-map-loader",
use: require.resolve("source-map-loader"),
},
{
test: /\.tsx?$/,
loader: "ts-loader",
loader: require.resolve("ts-loader"),
options: {
configFile: "test/tsconfig.json",
transpileOnly: true,
Expand All @@ -45,7 +44,7 @@ module.exports = {
{
enforce: "post",
test: /src\/.*\.tsx?$/,
loader: "istanbul-instrumenter-loader",
loader: require.resolve("istanbul-instrumenter-loader"),
options: {
esModules: true,
},
Expand Down
Loading

0 comments on commit eba785b

Please sign in to comment.