init: sudah ganti logo, hilangin setting, dan investigational use dialog
This commit is contained in:
29
.webpack/rules/cssToJavaScript.js
Normal file
29
.webpack/rules/cssToJavaScript.js
Normal file
@@ -0,0 +1,29 @@
|
||||
const autoprefixer = require('autoprefixer');
|
||||
const path = require('path');
|
||||
const tailwindcss = require('tailwindcss');
|
||||
const tailwindConfigPath = path.resolve('../../platform/app/tailwind.config.js');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const devMode = process.env.NODE_ENV !== 'production';
|
||||
|
||||
const cssToJavaScript = {
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
//'style-loader',
|
||||
devMode ? 'style-loader' : MiniCssExtractPlugin.loader,
|
||||
{ loader: 'css-loader', options: { importLoaders: 1 } },
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
postcssOptions: {
|
||||
verbose: true,
|
||||
plugins: [
|
||||
[tailwindcss(tailwindConfigPath)],
|
||||
[autoprefixer('last 2 version', 'ie >= 11')],
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
module.exports = cssToJavaScript;
|
||||
10
.webpack/rules/loadShaders.js
Normal file
10
.webpack/rules/loadShaders.js
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* This is exclusively used by `vtk.js` to bundle glsl files.
|
||||
*/
|
||||
const loadShaders = {
|
||||
test: /\.glsl$/i,
|
||||
include: /vtk\.js[\/\\]Sources/,
|
||||
loader: 'shader-loader',
|
||||
};
|
||||
|
||||
module.exports = loadShaders;
|
||||
17
.webpack/rules/loadWebWorkers.js
Normal file
17
.webpack/rules/loadWebWorkers.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* This allows us to include web workers in our bundle, and VTK.js
|
||||
* web workers in our bundle. While this increases bundle size, it
|
||||
* cuts down on the number of includes we need for `script tag` usage.
|
||||
*/
|
||||
const loadWebWorkers = {
|
||||
test: /\.worker\.js$/,
|
||||
include: /vtk\.js[\/\\]Sources/,
|
||||
use: [
|
||||
{
|
||||
loader: 'worker-loader',
|
||||
options: { inline: true, fallback: false },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
module.exports = loadWebWorkers;
|
||||
10
.webpack/rules/stylusToJavaScript.js
Normal file
10
.webpack/rules/stylusToJavaScript.js
Normal file
@@ -0,0 +1,10 @@
|
||||
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;
|
||||
45
.webpack/rules/transpileJavaScript.js
Normal file
45
.webpack/rules/transpileJavaScript.js
Normal file
@@ -0,0 +1,45 @@
|
||||
const excludeNodeModulesExcept = require('./../helpers/excludeNodeModulesExcept.js');
|
||||
|
||||
function transpileJavaScript(mode) {
|
||||
const exclude =
|
||||
mode === 'production'
|
||||
? excludeNodeModulesExcept([
|
||||
// 'dicomweb-client',
|
||||
// https://github.com/react-dnd/react-dnd/blob/master/babel.config.js
|
||||
'react-dnd',
|
||||
// https://github.com/dcmjs-org/dcmjs/blob/master/.babelrc
|
||||
// https://github.com/react-dnd/react-dnd/issues/1342
|
||||
// 'dcmjs', // contains: loglevelnext
|
||||
// https://github.com/shellscape/loglevelnext#browser-support
|
||||
// 'loglevelnext',
|
||||
// https://github.com/dcmjs-org/dicom-microscopy-viewer/issues/35
|
||||
// 'dicom-microscopy-viewer',
|
||||
// https://github.com/openlayers/openlayers#supported-browsers
|
||||
// 'ol', --> Should be fine
|
||||
])
|
||||
: excludeNodeModulesExcept([]);
|
||||
|
||||
return {
|
||||
// Include mjs, ts, tsx, js, and jsx files.
|
||||
test: /\.(mjs|ts|js)x?$/,
|
||||
// These are packages that are not transpiled to our lowest supported
|
||||
// JS version (currently ES5). Most of these leverage ES6+ features,
|
||||
// that we need to transpile to a different syntax.
|
||||
exclude: [/(codecs)/, /(dicomicc)/, exclude],
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
// Find babel.config.js in monorepo root
|
||||
// https://babeljs.io/docs/en/options#rootmode
|
||||
rootMode: 'upward',
|
||||
envName: mode,
|
||||
cacheCompression: false,
|
||||
// Note: This was causing a lot of issues with yarn link of the cornerstone
|
||||
// only set this to true if you don't have a yarn link to external libs
|
||||
// otherwise expect the lib changes not to be reflected in the dev server
|
||||
// as it will be cached
|
||||
cacheDirectory: false,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = transpileJavaScript;
|
||||
Reference in New Issue
Block a user