chore: Clean up unused files, imports, and work on getting end-to-end tests and unit tests running (#2272)

This commit is contained in:
Erik Ziegler authored and GitHub committed 2021-03-01 16:52:54 +01:00
1 parent 414ebc6850
commit 0db81b30f3
374 files changed
+14138 -21288

No files matched your search

-10
View File
@@ -1,10 +0,0 @@
const stylusToJavaScript = {
test: /\.styl$/,
use: [
{ loader: 'style-loader' }, // 3. Style nodes from JS Strings
{ loader: 'css-loader' }, // 2. CSS to CommonJS
{ loader: 'stylus-loader' }, // 1. Stylus to CSS
],
};
module.exports = stylusToJavaScript;
+13
View File
@@ -14,6 +14,7 @@ const TerserJSPlugin = require('terser-webpack-plugin');
const NODE_ENV = process.env.NODE_ENV;
const QUICK_BUILD = process.env.QUICK_BUILD;
const BUILD_NUM = process.env.CIRCLE_BUILD_NUM || '0';
const { UnusedFilesWebpackPlugin } = require("unused-files-webpack-plugin");
//
dotenv.config();
@@ -99,6 +100,18 @@ module.exports = (env, argv, { SRC_DIR, DIST_DIR }) => {
process.env.LOCIZE_API_KEY || ''
),
}),
new UnusedFilesWebpackPlugin({
failOnUnused: true,
globOptions: {
ignore: [
"node_modules/**/*",
"index.umd.js",
"sanity.test.js",
"__mocks__/fileMock.js",
"__tests__/globalSetup.js"
]
}
}),
],
// Fix: https://github.com/webpack-contrib/css-loader/issues/447#issuecomment-285598881
// For issue in cornerstone-wado-image-loader
-19
View File
@@ -1,19 +0,0 @@
const merge = require('webpack-merge');
const webpackBase = require('./webpack.base.js');
const cssToJavaScriptRule = require('./rules/cssToJavaScript.js');
const stylusToJavaScriptRule = require('./rules/stylusToJavaScript.js');
/**
* WebPack configuration for CommonJS Bundles. Extends rules of BaseConfig by making
* sure we're bundling styles and other files that would normally be split in a
* PWA.
*/
module.exports = (env, argv, { SRC_DIR, DIST_DIR }) => {
const baseConfig = webpackBase(env, argv, { SRC_DIR, DIST_DIR });
return merge(baseConfig, {
module: {
rules: [cssToJavaScriptRule, stylusToJavaScriptRule],
},
});
};