clientjs/packages/dashboard-components/webpack.config.js
changeset 6 819a7ab4e3fb
parent 0 5f4fcbc80b37
child 11 37ecf0b9c174
equal deleted inserted replaced
5:b26c9c44dd84 6:819a7ab4e3fb
     1 const path = require('path');
     1 const path = require('path');
     2 // const nodeExternals = require('webpack-node-externals');
     2 // const nodeExternals = require('webpack-node-externals');
     3 const MiniCssExtractPlugin = require('mini-css-extract-plugin');
     3 const MiniCssExtractPlugin = require('mini-css-extract-plugin');
     4 
     4 
     5 module.exports = {
     5 module.exports = {
     6   entry: path.resolve(__dirname, 'src/index.js'),
     6   entry: {
       
     7     pages: path.resolve(__dirname, 'src/pages'),
       
     8     layouts: path.resolve(__dirname, 'src/layouts'),
       
     9     reducers: path.resolve(__dirname, 'src/reducers'),
       
    10     ui: path.resolve(__dirname, 'src/ui'),
       
    11     actions: path.resolve(__dirname, 'src/actions.js'),
       
    12   },
       
    13   // path.resolve(__dirname, 'src/index.js'),
     7   output: {
    14   output: {
     8     path: path.resolve(__dirname, 'lib'),
    15     path: path.resolve(__dirname, 'lib'),
     9     filename: 'dashboard-components.js',
    16     // filename: 'dashboard-components.[name].js',
    10     library: '',
    17     filename: '[name].js',
    11     libraryTarget: 'commonjs2',
    18     library: ['dashboard-components', '[name]'],
       
    19     libraryTarget: 'umd',
    12   },
    20   },
    13   resolve: {
    21   resolve: {
    14     extensions: ['.wasm', '.mjs', '.js', '.json', '.jsx'],
    22     extensions: ['.wasm', '.mjs', '.js', '.json', '.jsx'],
    15   },
    23   },
    16   // externals: [nodeExternals()],
    24   // externals: [nodeExternals()],
    54       },
    62       },
    55     ],
    63     ],
    56   },
    64   },
    57   plugins: [
    65   plugins: [
    58     new MiniCssExtractPlugin({
    66     new MiniCssExtractPlugin({
    59       filename: 'dashboard-components.css',
    67       // filename: 'dashboard-components.[name].css',
       
    68       filename: '[name].css',
    60     }),
    69     }),
    61   ],
    70   ],
    62   performance: {
    71   performance: {
    63     hints: false,
    72     hints: false,
    64   },
    73   },