Provide WebPack build options for microscopy, vtk, and ui

This commit is contained in:
dannyrb committed 2019-07-09 12:39:15 -04:00
1 parent 2234869b11
commit 2429294dda
9 files changed
+183 -24

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@
"author": "OHIF",
"license": "MIT",
"repository": "OHIF/Viewers",
"main": "dist/index.js",
"main": "dist/index.umd.js",
"module": "src/index.js",
"engines": {
"node": ">=8",
-1
View File
@@ -6,7 +6,6 @@
"license": "MIT",
"repository": "OHIF/Viewers",
"main": "dist/index.umd.js",
"module": "src/index.js",
"engines": {
"node": ">=8",
"npm": ">=5"
+10 -17
View File
@@ -10,7 +10,6 @@ import copy from 'rollup-plugin-copy';
// Deal with https://github.com/rollup/rollup-plugin-commonjs/issues/297
const globals = {
react: 'React',
'react-dom': 'ReactDOM',
@@ -26,7 +25,7 @@ const globals = {
'dicom-parser': 'dicomParser',
'ohif-core': 'OHIF',
hammerjs: 'Hammer',
'@ohif/i18n': 'i18n'
'@ohif/i18n': 'i18n',
};
export default {
@@ -37,26 +36,26 @@ export default {
format: 'umd',
name: 'ohif-vtk-extension',
sourcemap: true,
globals
globals,
},
{
file: pkg.module,
format: 'es',
sourcemap: true,
globals
}
globals,
},
],
plugins: [
builtins(),
external(),
postcss({
modules: false
modules: false,
}),
url(),
babel({
exclude: 'node_modules/**',
externalHelpers: true,
runtimeHelpers: true
runtimeHelpers: true,
}),
copy({
targets: ['src/locales'],
@@ -70,16 +69,10 @@ export default {
'getImageData',
'loadImageData',
'VTKViewport',
'VTKMPRViewport'
'VTKMPRViewport',
],
'.yalc/react-vtkjs-viewport/dist/index.js': [
'getImageData',
'loadImageData',
'VTKViewport',
'VTKMPRViewport'
]
}
})
},
}),
],
external: Object.keys(pkg.peerDependencies || {})
external: Object.keys(pkg.peerDependencies || {}),
};
+4 -4
View File
@@ -56,13 +56,13 @@ const cssRules = [
];
var entry = path.join(__dirname, './src/index.js');
const sourcePath = path.join(__dirname, './src');
const outputPath = path.join(__dirname, './dist');
const SRC_DIR = path.join(__dirname, './src');
const OUTPUT_DIR = path.join(__dirname, './dist');
module.exports = {
entry,
output: {
path: outputPath,
path: OUTPUT_DIR,
filename: 'index.umd.js',
library: '@ohif/extension-vtk',
libraryTarget: 'umd',
@@ -98,7 +98,7 @@ module.exports = {
path.resolve(__dirname, 'node_modules'),
// Hoisted Yarn Workspace Modules
path.resolve(__dirname, '../../node_modules'),
sourcePath,
SRC_DIR,
],
},
externals: [