chore(build): try to build demo and docs (#3434)

This commit is contained in:
Alireza authored and GitHub committed 2023-06-06 13:34:26 -04:00
1 parent 869b8ced05
commit 828690cd3b
329 files changed
+1896 -1010

No files matched your search

+4 -1
View File
@@ -2,7 +2,10 @@ const path = require('path');
const webpackCommon = require('./../../../.webpack/webpack.base.js');
const SRC_DIR = path.join(__dirname, '../src');
const DIST_DIR = path.join(__dirname, '../dist');
const ENTRY = {
app: `${SRC_DIR}/index.tsx`,
};
module.exports = (env, argv) => {
return webpackCommon(env, argv, { SRC_DIR, DIST_DIR });
return webpackCommon(env, argv, { SRC_DIR, DIST_DIR, ENTRY });
};
+22 -9
View File
@@ -1,6 +1,8 @@
const { merge } = require('webpack-merge');
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin;
const webpackCommon = require('./../../../.webpack/webpack.base.js');
const pkg = require('./../package.json');
@@ -9,8 +11,14 @@ const ROOT_DIR = path.join(__dirname, './..');
const SRC_DIR = path.join(__dirname, '../src');
const DIST_DIR = path.join(__dirname, '../dist');
const ENTRY = {
app: `${SRC_DIR}/index.js`,
};
const outputName = `ohif-${pkg.name.split('/').pop()}`;
module.exports = (env, argv) => {
const commonConfig = webpackCommon(env, argv, { SRC_DIR, DIST_DIR });
const commonConfig = webpackCommon(env, argv, { SRC_DIR, DIST_DIR, ENTRY });
return merge(commonConfig, {
stats: {
@@ -26,23 +34,28 @@ module.exports = (env, argv) => {
},
optimization: {
minimize: true,
sideEffects: true,
sideEffects: false,
},
output: {
path: ROOT_DIR,
library: 'ohifUi',
library: 'ohif-ui',
libraryTarget: 'umd',
filename: pkg.main,
},
externals: {
react: 'React',
'react-dom': 'ReactDOM',
},
externals: [
/\b(dcmjs)/,
/\b(gl-matrix)/,
{
react: 'React',
'react-dom': 'ReactDOM',
},
],
plugins: [
new MiniCssExtractPlugin({
filename: `./dist/[name].css`,
chunkFilename: `./dist/[id].css`,
filename: `./dist/${outputName}.css`,
chunkFilename: `./dist/${outputName}.css`,
}),
// new BundleAnalyzerPlugin({}),
],
});
};