1 |
|
2 |
|
3 | const webpack = require('webpack');
|
4 | const path = require('path');
|
5 |
|
6 | let libraryName = 'js2flowchart';
|
7 |
|
8 | let plugins = [], outputFile;
|
9 |
|
10 | outputFile = libraryName + '.js';
|
11 |
|
12 | const config = {
|
13 | entry: __dirname + '/index.js',
|
14 | devtool: 'source-map',
|
15 | output: {
|
16 | path: __dirname + '/dist',
|
17 | filename: outputFile,
|
18 | library: libraryName,
|
19 | libraryTarget: 'umd',
|
20 | umdNamedDefine: true
|
21 | },
|
22 | module: {
|
23 | rules: [
|
24 | {
|
25 | test: /(\.jsx|\.js)$/,
|
26 | loader: 'babel-loader',
|
27 | exclude: /(node_modules|bower_components)/
|
28 | }
|
29 | ]
|
30 | },
|
31 | resolve: {
|
32 | modules: [
|
33 | path.resolve('./node_modules'), path.resolve('./src'),
|
34 | path.resolve('./src/shared'), path.resolve('./src/render'),
|
35 | path.resolve('./src/builder'), path.resolve('./src/presentation-generator')
|
36 | ],
|
37 | extensions: ['.json', '.js']
|
38 | },
|
39 | plugins: plugins
|
40 | };
|
41 |
|
42 | module.exports = config;
|