clientjs/packages/dashboard-components/webpack.config.js
changeset 6 819a7ab4e3fb
parent 0 5f4fcbc80b37
child 11 37ecf0b9c174
--- a/clientjs/packages/dashboard-components/webpack.config.js	Mon Sep 17 10:47:06 2018 +0200
+++ b/clientjs/packages/dashboard-components/webpack.config.js	Mon Sep 17 15:32:33 2018 +0200
@@ -3,12 +3,20 @@
 const MiniCssExtractPlugin = require('mini-css-extract-plugin');
 
 module.exports = {
-  entry: path.resolve(__dirname, 'src/index.js'),
+  entry: {
+    pages: path.resolve(__dirname, 'src/pages'),
+    layouts: path.resolve(__dirname, 'src/layouts'),
+    reducers: path.resolve(__dirname, 'src/reducers'),
+    ui: path.resolve(__dirname, 'src/ui'),
+    actions: path.resolve(__dirname, 'src/actions.js'),
+  },
+  // path.resolve(__dirname, 'src/index.js'),
   output: {
     path: path.resolve(__dirname, 'lib'),
-    filename: 'dashboard-components.js',
-    library: '',
-    libraryTarget: 'commonjs2',
+    // filename: 'dashboard-components.[name].js',
+    filename: '[name].js',
+    library: ['dashboard-components', '[name]'],
+    libraryTarget: 'umd',
   },
   resolve: {
     extensions: ['.wasm', '.mjs', '.js', '.json', '.jsx'],
@@ -56,7 +64,8 @@
   },
   plugins: [
     new MiniCssExtractPlugin({
-      filename: 'dashboard-components.css',
+      // filename: 'dashboard-components.[name].css',
+      filename: '[name].css',
     }),
   ],
   performance: {