Begin updating dependent libraries to use sync'd webpack builds w/ watches
This commit is contained in:
parent
3e1e456cc2
commit
e250ac0c50
8
aliases.config.js
Normal file
8
aliases.config.js
Normal file
@ -0,0 +1,8 @@
|
||||
/* Used by webpack, babel and eslint */
|
||||
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
'@codinsky/parse-js': path.resolve(__dirname, 'packages/parse/src'),
|
||||
'@codinsky/curate': path.resolve(__dirname, 'packages/curate/src'),
|
||||
};
|
||||
@ -1,20 +1,48 @@
|
||||
const aliases = require('./aliases.config');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
// https://babeljs.io/docs/en/options#babelrcroots
|
||||
presets: [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
'@babel/preset-env',
|
||||
{
|
||||
targets: {
|
||||
ie: "11"
|
||||
}
|
||||
}
|
||||
ie: '11',
|
||||
},
|
||||
},
|
||||
],
|
||||
"@babel/preset-react"
|
||||
'@babel/preset-react',
|
||||
],
|
||||
plugins: [
|
||||
"@babel/plugin-proposal-class-properties",
|
||||
"@babel/plugin-proposal-object-rest-spread",
|
||||
"@babel/plugin-syntax-dynamic-import",
|
||||
"@babel/plugin-transform-regenerator",
|
||||
"@babel/plugin-transform-runtime"
|
||||
]
|
||||
'@babel/plugin-proposal-class-properties',
|
||||
'@babel/plugin-proposal-object-rest-spread',
|
||||
'@babel/plugin-syntax-dynamic-import',
|
||||
'@babel/plugin-transform-regenerator',
|
||||
'@babel/plugin-transform-runtime',
|
||||
[
|
||||
'module-resolver',
|
||||
{
|
||||
// https://github.com/tleunen/babel-plugin-module-resolver/issues/338
|
||||
// There seem to be a bug with module-resolver with a mono-repo setup:
|
||||
// It doesn't resolve paths correctly when using root/alias combo, so we
|
||||
// use this function instead.
|
||||
resolvePath(sourcePath, currentFile, opts) {
|
||||
// This will return undefined if aliases has no key for the sourcePath,
|
||||
// in which case module-resolver will fallback on its default behaviour.
|
||||
return aliases[sourcePath];
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
env: {
|
||||
debug: {
|
||||
sourceMaps: 'inline',
|
||||
retainLines: true,
|
||||
},
|
||||
build: {
|
||||
ignore: ['**/*.test.jsx', '**/*.test.js', '__snapshots__', '__tests__'],
|
||||
},
|
||||
},
|
||||
ignore: ['node_modules'],
|
||||
};
|
||||
|
||||
8
eslintAliasesResolver.js
Normal file
8
eslintAliasesResolver.js
Normal file
@ -0,0 +1,8 @@
|
||||
module.exports.interfaceVersion = 2;
|
||||
|
||||
module.exports.resolve = (source, file, aliases) => {
|
||||
if (aliases[source]) {
|
||||
return { found: true, path: aliases[source] };
|
||||
}
|
||||
return { found: false };
|
||||
};
|
||||
58
package.json
58
package.json
@ -4,13 +4,69 @@
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"start": "lerna run lerna:start --parallel",
|
||||
"build": "lerna exec --parallel -- babel --root-mode upward src -d lib --ignore **/*.story.js,**/*.spec.js"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,json,md,yml}": [
|
||||
"prettier --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not ie <= 11",
|
||||
"not op_mini all"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.5.0",
|
||||
"@babel/plugin-proposal-class-properties": "^7.5.0",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.5.0",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
|
||||
"@babel/plugin-transform-runtime": "^7.5.0",
|
||||
"@babel/preset-env": "^7.5.0",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"lerna": "^3.15.0"
|
||||
"babel-eslint": "^10.0.2",
|
||||
"babel-loader": "^8.0.6",
|
||||
"babel-plugin-module-resolver": "^3.2.0",
|
||||
"copy-webpack-plugin": "^5.0.3",
|
||||
"cross-env": "^5.2.0",
|
||||
"css-loader": "^3.0.0",
|
||||
"eslint": "^6.0.1",
|
||||
"eslint-plugin-import": "^2.18.0",
|
||||
"eslint-plugin-node": "^9.1.0",
|
||||
"eslint-plugin-promise": "^4.2.1",
|
||||
"eslint-plugin-react": "^7.14.2",
|
||||
"extract-css-chunks-webpack-plugin": "^4.5.4",
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"husky": "^3.0.0",
|
||||
"jest": "^24.8.0",
|
||||
"jest-canvas-mock": "^2.1.0",
|
||||
"jest-junit": "^6.4.0",
|
||||
"lerna": "^3.15.0",
|
||||
"lint-staged": "^9.0.2",
|
||||
"postcss-import": "^12.0.1",
|
||||
"postcss-loader": "^3.0.0",
|
||||
"postcss-preset-env": "^6.6.0",
|
||||
"prettier": "^1.18.2",
|
||||
"react": "^16.8.6",
|
||||
"react-dom": "^16.8.6",
|
||||
"react-scripts": "^3.0.1",
|
||||
"stylelint": "^10.1.0",
|
||||
"stylelint-config-recommended": "^2.2.0",
|
||||
"stylus": "^0.54.5",
|
||||
"webpack": "^4.35.2",
|
||||
"webpack-cli": "^3.3.5",
|
||||
"webpack-dev-server": "^3.7.2",
|
||||
"webpack-hot-middleware": "^2.25.0",
|
||||
"webpack-merge": "^4.2.1",
|
||||
"workbox-webpack-plugin": "^4.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,23 +26,6 @@
|
||||
"contributors:add": "all-contributors add",
|
||||
"contributors:generate": "all-contributors generate"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"src/**/*.{js,jsx,json,css}": [
|
||||
"prettier --single-quote --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not ie <= 11",
|
||||
"not op_mini all"
|
||||
],
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
@ -74,7 +57,6 @@
|
||||
"@mdx-js/tag": "^0.20.3",
|
||||
"all-contributors-cli": "6.7.0",
|
||||
"autoprefixer": "^9.6.0",
|
||||
"babel-eslint": "^9.0.0",
|
||||
"babel-plugin-inline-react-svg": "1.1.0",
|
||||
"commitizen": "3.0.7",
|
||||
"cpx": "1.5.0",
|
||||
@ -84,34 +66,9 @@
|
||||
"docz-core": "1.2.0",
|
||||
"docz-plugin-css": "0.11.0",
|
||||
"docz-theme-default": "1.2.0",
|
||||
"eslint": "5.12.0",
|
||||
"eslint-config-prettier": "4.1.0",
|
||||
"eslint-plugin-import": "^2.14.0",
|
||||
"eslint-plugin-node": "^8.0.0",
|
||||
"eslint-plugin-prettier": "3.0.1",
|
||||
"eslint-plugin-promise": "^4.0.1",
|
||||
"eslint-plugin-react": "^7.11.1",
|
||||
"husky": "^1.3.1",
|
||||
"lint-staged": "^8.1.0",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"prettier": "1.16.4",
|
||||
"react": "16.8.6",
|
||||
"react-dom": "16.8.6",
|
||||
"react-powerplug": "1.0.0",
|
||||
"react-scripts": "^2.1.5",
|
||||
"rollup": "^0.68.2",
|
||||
"rollup-plugin-babel": "^4.2.0",
|
||||
"rollup-plugin-commonjs": "^9.2.0",
|
||||
"rollup-plugin-node-builtins": "^2.1.2",
|
||||
"rollup-plugin-node-resolve": "^4.0.0",
|
||||
"rollup-plugin-peer-deps-external": "^2.2.0",
|
||||
"rollup-plugin-postcss": "^1.6.3",
|
||||
"rollup-plugin-url": "^2.1.0",
|
||||
"semantic-release": "15.13.x",
|
||||
"stylelint": "^9.9.0",
|
||||
"stylelint-config-recommended": "^2.1.0",
|
||||
"stylus": "^0.54.5",
|
||||
"webpack": "4.28.4"
|
||||
"semantic-release": "15.13.x"
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
|
||||
@ -25,48 +25,11 @@
|
||||
"react-i18next": "^10.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^10.0.1",
|
||||
"cross-env": "^5.2.0",
|
||||
"eslint": "5.13.0",
|
||||
"eslint-plugin-import": "^2.14.0",
|
||||
"eslint-plugin-node": "^8.0.0",
|
||||
"eslint-plugin-promise": "^4.0.1",
|
||||
"eslint-plugin-react": "^7.11.1",
|
||||
"husky": "^1.3.1",
|
||||
"i18next": "^15.1.3",
|
||||
"i18next-browser-languagedetector": "^3.0.1",
|
||||
"lint-staged": "^8.1.0",
|
||||
"locize-cli": "^4.8.0",
|
||||
"prettier": "^1.15.3",
|
||||
"react": "^16.0.0",
|
||||
"react-dom": "^16.0.0",
|
||||
"react-i18next": "^10.11.0",
|
||||
"rollup": "^1.1.2",
|
||||
"rollup-plugin-babel": "^4.2.0",
|
||||
"rollup-plugin-commonjs": "^9.2.0",
|
||||
"rollup-plugin-node-builtins": "^2.1.2",
|
||||
"rollup-plugin-node-resolve": "^4.0.0",
|
||||
"rollup-plugin-peer-deps-external": "^2.2.0",
|
||||
"rollup-plugin-postcss": "^2.0.3",
|
||||
"rollup-plugin-url": "^2.1.0"
|
||||
"react-i18next": "^10.11.0"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"src/**/*.{js,jsx,json,css}": [
|
||||
"prettier --single-quote --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not ie <= 11",
|
||||
"not op_mini all"
|
||||
],
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
|
||||
92
packages/_viewer/config/webpack.common.js
Normal file
92
packages/_viewer/config/webpack.common.js
Normal file
@ -0,0 +1,92 @@
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const ExtractCssChunks = require('extract-css-chunks-webpack-plugin');
|
||||
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const PUBLIC_DIR = path.join(__dirname, '../public');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
// console.log(process);
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
// console.log(env);
|
||||
// console.log(argv);
|
||||
return {
|
||||
entry: {
|
||||
app: `${SRC_DIR}/index.js`,
|
||||
},
|
||||
context: SRC_DIR,
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx', '.json', '*'],
|
||||
symlinks: true,
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: [/node_modules/, /packages\\extension/],
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
// Find babel.config.js in monorepo root
|
||||
// https://babeljs.io/docs/en/options#rootmode
|
||||
rootMode: 'upward',
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
// Do not transform ES6 modules to another format.
|
||||
// Webpack will take care of that.
|
||||
modules: false,
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
'style-loader',
|
||||
ExtractCssChunks.loader,
|
||||
{ loader: 'css-loader', options: { importLoaders: 1 } },
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
config: {
|
||||
path: './postcss.config.js',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
// "Public" Folder
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: PUBLIC_DIR,
|
||||
to: DIST_DIR,
|
||||
toType: 'dir',
|
||||
// Ignore our HtmlWebpackPlugin template file
|
||||
ignore: ['index.html', '.DS_Store'],
|
||||
},
|
||||
]),
|
||||
new webpack.EnvironmentPlugin(['NODE_ENV']),
|
||||
new ExtractCssChunks({
|
||||
filename: '[name].css',
|
||||
chunkFilename: '[id].css',
|
||||
// hot: true /* only necessary if hot reloading not function*/
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
template: `${PUBLIC_DIR}/index.html`,
|
||||
filename: 'index.html',
|
||||
templateParameters: {
|
||||
PUBLIC_URL: '',
|
||||
REACT_APP_CONFIG: 'config/default.js',
|
||||
},
|
||||
// favicon: `${PUBLIC_DIR}/favicon.ico`,
|
||||
}),
|
||||
],
|
||||
};
|
||||
};
|
||||
57
packages/_viewer/config/webpack.dev.js
Normal file
57
packages/_viewer/config/webpack.dev.js
Normal file
@ -0,0 +1,57 @@
|
||||
const webpack = require('webpack');
|
||||
const merge = require('webpack-merge');
|
||||
const path = require('path');
|
||||
const common = require('./webpack.common');
|
||||
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
const commonConfig = common(env, argv);
|
||||
|
||||
return merge(commonConfig, {
|
||||
mode: 'development',
|
||||
devtool: 'cheap-module-source-map',
|
||||
output: {
|
||||
path: DIST_DIR,
|
||||
filename: 'bundle.js',
|
||||
publicPath: '/public/',
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(gif|jp?g|png|svg|ico)$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: '[path][name].[ext]',
|
||||
context: SRC_DIR,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(ttf|eot|woff|woff2)$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: '[name].[ext]',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [new webpack.HotModuleReplacementPlugin()],
|
||||
devServer: {
|
||||
hot: true,
|
||||
inline: true,
|
||||
compress: true,
|
||||
contentBase: DIST_DIR,
|
||||
port: 3000,
|
||||
writeToDisk: true,
|
||||
},
|
||||
});
|
||||
};
|
||||
69
packages/_viewer/config/webpack.prod.js
Normal file
69
packages/_viewer/config/webpack.prod.js
Normal file
@ -0,0 +1,69 @@
|
||||
const merge = require('webpack-merge');
|
||||
const path = require('path');
|
||||
|
||||
const workboxPlugin = require('workbox-webpack-plugin');
|
||||
|
||||
const common = require('./webpack.common');
|
||||
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
const commonConfig = common(env, argv);
|
||||
|
||||
return merge(commonConfig, {
|
||||
mode: 'production',
|
||||
stats: {
|
||||
colors: false,
|
||||
hash: true,
|
||||
timings: true,
|
||||
assets: true,
|
||||
chunks: true,
|
||||
chunkModules: true,
|
||||
modules: true,
|
||||
children: true,
|
||||
warnings: true,
|
||||
},
|
||||
optimization: {
|
||||
minimize: true,
|
||||
sideEffects: true,
|
||||
},
|
||||
output: {
|
||||
path: DIST_DIR,
|
||||
filename: '[name].bundle.[chunkhash].js',
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(gif|jpe?g|png|svg)$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 8192,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(ttf|eot|woff|woff2)$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 50000,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new workboxPlugin.GenerateSW({
|
||||
swDest: 'sw.js',
|
||||
clientsClaim: true,
|
||||
skipWaiting: true,
|
||||
}),
|
||||
],
|
||||
});
|
||||
};
|
||||
@ -15,9 +15,10 @@
|
||||
},
|
||||
"proxy": "http://localhost:8042",
|
||||
"scripts": {
|
||||
"lerna:start": "cross-env NODE_ENV=development webpack-dev-server --config config/webpack.dev.js --mode development -w -d",
|
||||
"cm": "npx git-cz",
|
||||
"dev": "yarn run preBuild && cross-env PORT=5000 react-scripts start",
|
||||
"dev:debug": "cross-env PORT=5000 react-scripts start",
|
||||
"dev": "yarn run preBuild && react-scripts start",
|
||||
"dev:debug": "react-scripts start",
|
||||
"build:package": "yarn run preBuild && node --max-old-space-size=4096 node_modules/rollup/bin/rollup -c",
|
||||
"build:package:ci": "yarn run preBuild && node --max-old-space-size=4096 node_modules/rollup/bin/rollup -c",
|
||||
"build:web": "yarn run preBuild && react-scripts --max_old_space_size=4096 build",
|
||||
@ -34,30 +35,13 @@
|
||||
"predeploy": "cd example && npm install && yarn run build:package",
|
||||
"preBuild": "yarn run version && yarn run copy:webworkers",
|
||||
"orthanc:up": "docker-compose -f docker/Nginx-Orthanc/docker-compose.yml up",
|
||||
"dev:orthanc": "yarn run preBuild && cross-env PORT=5000 REACT_APP_CONFIG=config/docker_nginx-orthanc.js react-scripts start",
|
||||
"dev:orthanc": "yarn run preBuild && cross-env REACT_APP_CONFIG=config/docker_nginx-orthanc.js react-scripts start",
|
||||
"version": "node -p -e \"'export default \\'' + require('./package.json').version + '\\';'\" > src/version.js",
|
||||
"copy:webworkers": "cpx \"node_modules/cornerstone-wado-image-loader/dist/*.min.js*\" \"public\" -v",
|
||||
"cy": "cypress open",
|
||||
"cy:run": "cypress run",
|
||||
"cy:run:ci": "yarn run cy:run -- --record"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"src/**/*.{js,jsx,json,css}": [
|
||||
"prettier --single-quote --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not ie <= 11",
|
||||
"not op_mini all"
|
||||
],
|
||||
"resolutions": {
|
||||
"browserslist": "4.6.2",
|
||||
"caniuse-lite": "1.0.30000974"
|
||||
@ -114,43 +98,17 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@semantic-release/exec": "3.3.3",
|
||||
"@svgr/rollup": "^4.3.0",
|
||||
"babel-eslint": "10.0.1",
|
||||
"codecov": "3.5.0",
|
||||
"commitizen": "3.1.x",
|
||||
"core-js": "^3.1.4",
|
||||
"cpx": "1.5.0",
|
||||
"cross-env": "^5.2.0",
|
||||
"cypress": "^3.3.1",
|
||||
"cz-conventional-changelog": "2.1.0",
|
||||
"eslint": "5.16.0",
|
||||
"eslint-plugin-import": "^2.17.3",
|
||||
"eslint-plugin-node": "^9.1.0",
|
||||
"eslint-plugin-promise": "^4.1.1",
|
||||
"eslint-plugin-react": "^7.13.0",
|
||||
"gh-pages": "2.0.1",
|
||||
"husky": "2.4.x",
|
||||
"identity-obj-proxy": "3.0.x",
|
||||
"jest-canvas-mock": "2.1.0",
|
||||
"jest-junit": "6.4.x",
|
||||
"lint-staged": "^8.2.1",
|
||||
"lodash": "4.17.11",
|
||||
"lodash.clonedeep": "4.5.0",
|
||||
"prettier": "1.18.x",
|
||||
"react": "^16.7.0",
|
||||
"react-dom": "^16.7.0",
|
||||
"react-scripts": "^3.0.1",
|
||||
"rollup": "^1.15.5",
|
||||
"rollup-plugin-babel": "^4.3.2",
|
||||
"rollup-plugin-commonjs": "^10.0.0",
|
||||
"rollup-plugin-json": "^4.0.0",
|
||||
"rollup-plugin-node-builtins": "^2.1.2",
|
||||
"rollup-plugin-node-resolve": "^5.0.2",
|
||||
"rollup-plugin-peer-deps-external": "^2.2.0",
|
||||
"rollup-plugin-postcss": "^2.0.3",
|
||||
"rollup-plugin-url": "^2.2.2",
|
||||
"semantic-release": "15.13.x",
|
||||
"start-server-and-test": "^1.9.1",
|
||||
"stylelint": "^10.1.0"
|
||||
"start-server-and-test": "^1.9.1"
|
||||
}
|
||||
}
|
||||
|
||||
9
packages/_viewer/postcss.config.js
Normal file
9
packages/_viewer/postcss.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
// parser: "sugarss",
|
||||
parser: false,
|
||||
plugins: {
|
||||
'postcss-import': {},
|
||||
'postcss-preset-env': {},
|
||||
cssnano: {},
|
||||
},
|
||||
};
|
||||
@ -8,10 +8,10 @@
|
||||
/>
|
||||
<meta name="theme-color" content="#000000" />
|
||||
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||
<link rel="manifest" href="<%= PUBLIC_URL %>/manifest.json" />
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="%PUBLIC_URL%/%REACT_APP_CONFIG%"
|
||||
src="<%= PUBLIC_URL %>/<%= REACT_APP_CONFIG %>"
|
||||
></script>
|
||||
|
||||
<title>OHIF Viewer</title>
|
||||
|
||||
@ -1,75 +0,0 @@
|
||||
import babel from 'rollup-plugin-babel'
|
||||
import commonjs from 'rollup-plugin-commonjs'
|
||||
import external from 'rollup-plugin-peer-deps-external'
|
||||
import postcss from 'rollup-plugin-postcss'
|
||||
import resolve from 'rollup-plugin-node-resolve'
|
||||
import json from 'rollup-plugin-json'
|
||||
import url from 'rollup-plugin-url'
|
||||
import svgr from '@svgr/rollup'
|
||||
import pkg from './package.json'
|
||||
// Deal with https://github.com/rollup/rollup-plugin-commonjs/issues/297
|
||||
import builtins from 'rollup-plugin-node-builtins'
|
||||
|
||||
const globals = {
|
||||
react: 'React',
|
||||
'react-dom': 'ReactDOM',
|
||||
}
|
||||
|
||||
export default {
|
||||
input: 'src/index_publish.js',
|
||||
output: [
|
||||
{
|
||||
file: pkg.main,
|
||||
format: 'umd',
|
||||
sourcemap: true,
|
||||
exports: 'named',
|
||||
name: 'OHIFStandaloneViewer',
|
||||
esModule: false,
|
||||
globals,
|
||||
},
|
||||
{
|
||||
file: pkg.module,
|
||||
format: 'es',
|
||||
exports: 'named',
|
||||
sourcemap: true,
|
||||
globals,
|
||||
},
|
||||
],
|
||||
plugins: [
|
||||
external(),
|
||||
postcss({
|
||||
modules: false,
|
||||
}),
|
||||
url(),
|
||||
svgr(),
|
||||
json(),
|
||||
resolve({preferBuiltins: true}),
|
||||
babel({
|
||||
exclude: 'node_modules/**',
|
||||
runtimeHelpers: true,
|
||||
}),
|
||||
commonjs({
|
||||
include: 'node_modules/**',
|
||||
namedExports: {
|
||||
'node_modules/react-is/index.js': [
|
||||
'isValidElementType',
|
||||
'isContextConsumer',
|
||||
],
|
||||
'node_modules/redux-oidc/dist/redux-oidc.js': [
|
||||
'reducer',
|
||||
'CallbackComponent',
|
||||
'loadUser',
|
||||
'OidcProvider',
|
||||
'createUserManager',
|
||||
],
|
||||
'node_modules/cornerstoneTools/dist/cornerstoneTools.min.js': [
|
||||
'cornerstoneTools',
|
||||
],
|
||||
'node_modules/dcmjs/build/dcmjs.js': ['data', 'adapters'],
|
||||
'node_modules/prop-types/index.js': ['bool', 'number', 'string', 'shape', 'func', 'any', 'node']
|
||||
},
|
||||
}),
|
||||
builtins(),
|
||||
],
|
||||
external: Object.keys(pkg.peerDependencies || {}),
|
||||
}
|
||||
67
packages/extension-cornerstone/config/webpack.common.js
Normal file
67
packages/extension-cornerstone/config/webpack.common.js
Normal file
@ -0,0 +1,67 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const ExtractCssChunks = require('extract-css-chunks-webpack-plugin');
|
||||
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
return {
|
||||
entry: {
|
||||
app: `${SRC_DIR}/index.js`,
|
||||
},
|
||||
context: SRC_DIR,
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx', '.json', '*'],
|
||||
symlinks: true,
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: [/node_modules/],
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
// Find babel.config.js in monorepo root
|
||||
// https://babeljs.io/docs/en/options#rootmode
|
||||
rootMode: 'upward',
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
// Do not transform ES6 modules to another format.
|
||||
// Webpack will take care of that.
|
||||
modules: false,
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
'style-loader',
|
||||
ExtractCssChunks.loader,
|
||||
{ loader: 'css-loader', options: { importLoaders: 1 } },
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
config: {
|
||||
path: './postcss.config.js',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new webpack.EnvironmentPlugin(['NODE_ENV']),
|
||||
new ExtractCssChunks({
|
||||
filename: '[name].css',
|
||||
chunkFilename: '[id].css',
|
||||
// hot: true /* only necessary if hot reloading not function*/
|
||||
}),
|
||||
],
|
||||
};
|
||||
};
|
||||
64
packages/extension-cornerstone/config/webpack.prod.js
Normal file
64
packages/extension-cornerstone/config/webpack.prod.js
Normal file
@ -0,0 +1,64 @@
|
||||
const merge = require('webpack-merge');
|
||||
const path = require('path');
|
||||
const common = require('./webpack.common');
|
||||
const pkg = require('./../package.json');
|
||||
|
||||
const ROOT_DIR = path.join(__dirname, './..');
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
const commonConfig = common(env, argv);
|
||||
|
||||
return merge(commonConfig, {
|
||||
mode: 'production',
|
||||
stats: {
|
||||
colors: false,
|
||||
hash: true,
|
||||
timings: true,
|
||||
assets: true,
|
||||
chunks: true,
|
||||
chunkModules: true,
|
||||
modules: true,
|
||||
children: true,
|
||||
warnings: true,
|
||||
},
|
||||
optimization: {
|
||||
minimize: true,
|
||||
sideEffects: true,
|
||||
},
|
||||
output: {
|
||||
path: ROOT_DIR,
|
||||
library: 'ohifCornerstoneExtension',
|
||||
libraryTarget: 'umd',
|
||||
filename: pkg.main,
|
||||
auxiliaryComment: 'Test Comment',
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(gif|jpe?g|png|svg)$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 8192,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(ttf|eot|woff|woff2)$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 50000,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
};
|
||||
@ -14,6 +14,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"hello": "webpack --config config/webpack.prod.js -w -d",
|
||||
"prepublishOnly": "npm run build",
|
||||
"start": "rollup -c -w",
|
||||
"lint": "eslint -c .eslintrc --fix src && prettier --single-quote --write src/**/*.{js,jsx,json,css}"
|
||||
@ -42,49 +43,9 @@
|
||||
"react-cornerstone-viewport": "0.1.30"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^10.0.1",
|
||||
"cross-env": "^5.2.0",
|
||||
"eslint": "5.13.0",
|
||||
"eslint-plugin-import": "^2.14.0",
|
||||
"eslint-plugin-node": "^8.0.0",
|
||||
"eslint-plugin-promise": "^4.0.1",
|
||||
"eslint-plugin-react": "^7.11.1",
|
||||
"gh-pages": "^2.0.1",
|
||||
"husky": "^1.3.1",
|
||||
"lint-staged": "^8.1.0",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"prettier": "^1.15.3",
|
||||
"react": "^16.6.3",
|
||||
"react-dom": "^16.6.3",
|
||||
"rollup": "^1.1.2",
|
||||
"rollup-plugin-babel": "^4.2.0",
|
||||
"rollup-plugin-commonjs": "^9.2.0",
|
||||
"rollup-plugin-node-builtins": "^2.1.2",
|
||||
"rollup-plugin-node-resolve": "^4.0.0",
|
||||
"rollup-plugin-peer-deps-external": "^2.2.0",
|
||||
"rollup-plugin-postcss": "^2.0.3",
|
||||
"rollup-plugin-url": "^2.1.0",
|
||||
"stylelint": "^9.9.0",
|
||||
"stylelint-config-recommended": "^2.1.0",
|
||||
"stylus": "^0.54.5"
|
||||
"lodash.clonedeep": "^4.5.0"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"src/**/*.{js,jsx,json,css}": [
|
||||
"prettier --single-quote --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not ie <= 11",
|
||||
"not op_mini all"
|
||||
],
|
||||
"files": [
|
||||
"dist",
|
||||
"README.md"
|
||||
|
||||
@ -29,51 +29,9 @@
|
||||
"@babel/runtime": "^7.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@svgr/rollup": "^4.1.0",
|
||||
"babel-eslint": "^9.0.0",
|
||||
"cross-env": "^5.2.0",
|
||||
"eslint": "5.6.0",
|
||||
"eslint-plugin-import": "^2.14.0",
|
||||
"eslint-plugin-node": "^8.0.0",
|
||||
"eslint-plugin-promise": "^4.0.1",
|
||||
"eslint-plugin-react": "^7.11.1",
|
||||
"gh-pages": "^2.0.1",
|
||||
"husky": "^1.3.1",
|
||||
"lint-staged": "^8.1.0",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"prettier": "^1.15.3",
|
||||
"react": "^16.6.3",
|
||||
"react-dom": "^16.6.3",
|
||||
"react-scripts": "^2.1.2",
|
||||
"rollup": "^0.68.2",
|
||||
"rollup-plugin-babel": "^4.2.0",
|
||||
"rollup-plugin-commonjs": "^9.2.0",
|
||||
"rollup-plugin-node-builtins": "^2.1.2",
|
||||
"rollup-plugin-node-resolve": "^4.0.0",
|
||||
"rollup-plugin-peer-deps-external": "^2.2.0",
|
||||
"rollup-plugin-postcss": "^1.6.3",
|
||||
"rollup-plugin-url": "^2.1.0",
|
||||
"stylelint": "^9.9.0",
|
||||
"stylelint-config-recommended": "^2.1.0",
|
||||
"stylus": "^0.54.5"
|
||||
"lodash.clonedeep": "^4.5.0"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"src/**/*.{js,jsx,json,css}": [
|
||||
"prettier --single-quote --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not ie <= 11",
|
||||
"not op_mini all"
|
||||
],
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
|
||||
@ -24,48 +24,8 @@
|
||||
"ohif-core": "^0.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^9.0.0",
|
||||
"cross-env": "^5.2.0",
|
||||
"eslint": "5.6.0",
|
||||
"eslint-plugin-import": "^2.14.0",
|
||||
"eslint-plugin-node": "^8.0.0",
|
||||
"eslint-plugin-promise": "^4.0.1",
|
||||
"eslint-plugin-react": "^7.11.1",
|
||||
"gh-pages": "^2.0.1",
|
||||
"husky": "^1.3.1",
|
||||
"lint-staged": "^8.1.0",
|
||||
"prettier": "^1.15.3",
|
||||
"react": "^16.6.3",
|
||||
"react-dom": "^16.6.3",
|
||||
"rollup": "^0.68.2",
|
||||
"rollup-plugin-babel": "^4.2.0",
|
||||
"rollup-plugin-commonjs": "^9.2.0",
|
||||
"rollup-plugin-node-builtins": "^2.1.2",
|
||||
"rollup-plugin-node-resolve": "^4.0.0",
|
||||
"rollup-plugin-peer-deps-external": "^2.2.0",
|
||||
"rollup-plugin-postcss": "^1.6.3",
|
||||
"rollup-plugin-url": "^2.1.0",
|
||||
"stylelint": "^9.9.0",
|
||||
"stylelint-config-recommended": "^2.1.0",
|
||||
"stylus": "^0.54.5"
|
||||
"gh-pages": "^2.0.1"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"src/**/*.{js,jsx,json,css}": [
|
||||
"prettier --single-quote --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not ie <= 11",
|
||||
"not op_mini all"
|
||||
],
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
|
||||
@ -31,51 +31,9 @@
|
||||
"lodash.isequal": "^4.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@svgr/rollup": "^4.1.0",
|
||||
"babel-eslint": "^9.0.0",
|
||||
"cross-env": "^5.2.0",
|
||||
"eslint": "5.6.0",
|
||||
"eslint-plugin-import": "^2.14.0",
|
||||
"eslint-plugin-node": "^8.0.0",
|
||||
"eslint-plugin-promise": "^4.0.1",
|
||||
"eslint-plugin-react": "^7.11.1",
|
||||
"gh-pages": "^2.0.1",
|
||||
"husky": "^1.3.1",
|
||||
"lint-staged": "^8.1.0",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"prettier": "^1.15.3",
|
||||
"react": "^16.6.3",
|
||||
"react-dom": "^16.6.3",
|
||||
"react-scripts": "^2.1.2",
|
||||
"rollup": "^0.68.2",
|
||||
"rollup-plugin-babel": "^4.2.0",
|
||||
"rollup-plugin-commonjs": "^9.2.0",
|
||||
"rollup-plugin-node-builtins": "^2.1.2",
|
||||
"rollup-plugin-node-resolve": "^4.0.0",
|
||||
"rollup-plugin-peer-deps-external": "^2.2.0",
|
||||
"rollup-plugin-postcss": "^1.6.3",
|
||||
"rollup-plugin-url": "^2.1.0",
|
||||
"stylelint": "^9.9.0",
|
||||
"stylelint-config-recommended": "^2.1.0",
|
||||
"stylus": "^0.54.5"
|
||||
"lodash.clonedeep": "^4.5.0"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"src/**/*.{js,jsx,json,css}": [
|
||||
"prettier --single-quote --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not ie <= 11",
|
||||
"not op_mini all"
|
||||
],
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
|
||||
@ -43,56 +43,21 @@
|
||||
"vtk.js": "^8.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^10.0.1",
|
||||
"babel-loader": "^8.0.6",
|
||||
"cornerstone-tools": "^3.13.0",
|
||||
"cornerstone-wado-image-loader": "^2.2.3",
|
||||
"cross-env": "^5.2.0",
|
||||
"dcmjs": "^0.4.7",
|
||||
"dicom-parser": "^1.8.3",
|
||||
"eslint": "5.16.0",
|
||||
"eslint-plugin-import": "^2.17.3",
|
||||
"eslint-plugin-node": "^9.1.0",
|
||||
"eslint-plugin-promise": "^4.1.1",
|
||||
"eslint-plugin-react": "^7.13.0",
|
||||
"gh-pages": "^2.0.1",
|
||||
"husky": "^2.4.1",
|
||||
"i18next": "^17.0.3",
|
||||
"i18next-browser-languagedetector": "^3.0.1",
|
||||
"lint-staged": "^8.2.0",
|
||||
"ohif-core": "^0.7.0",
|
||||
"prettier": "^1.18.2",
|
||||
"react": "^16.6.3",
|
||||
"react-dom": "^16.6.3",
|
||||
"react-i18next": "^10.11.0",
|
||||
"react-redux": "^7.1.0",
|
||||
"react-viewerbase": "^0.15.1",
|
||||
"redux": "^4.0.1",
|
||||
"shader-loader": "^1.3.1",
|
||||
"stylelint": "^10.1.0",
|
||||
"stylelint-config-recommended": "^2.2.0",
|
||||
"stylus": "^0.54.5",
|
||||
"webpack": "^4.33.0",
|
||||
"webpack-cli": "^3.3.4",
|
||||
"worker-loader": "^2.0.0"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"src/**/*.{js,jsx,json,css}": [
|
||||
"prettier --single-quote --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not ie <= 11",
|
||||
"not op_mini all"
|
||||
],
|
||||
"files": [
|
||||
"dist",
|
||||
"README.md"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user