1 | const path = require('path');
|
2 | const webpack = require('webpack');
|
3 | const FlowBabelWebpackPlugin = require('flow-babel-webpack-plugin');
|
4 | const HtmlWebpackPlugin = require('html-webpack-plugin');
|
5 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
6 | const fs = require('fs');
|
7 |
|
8 | const config = {
|
9 | module:{
|
10 | rules: [{
|
11 | test: /\.(js)$/,
|
12 | exclude: /node_modules/,
|
13 | use: {
|
14 | loader: "babel-loader"
|
15 | }
|
16 | }, ]
|
17 | },
|
18 | plugins: [new FlowBabelWebpackPlugin()]
|
19 | }
|
20 |
|
21 | const prodConfig = Object.assign({}, config, {
|
22 | entry: './src/ison.js',
|
23 | output: {
|
24 | path: path.resolve(__dirname, 'dist'),
|
25 | filename: 'ison.js',
|
26 | library: 'ison-js',
|
27 | libraryTarget: "umd",
|
28 | auxiliaryComment: {
|
29 | root: "Root Comment",
|
30 | commonjs: "CommonJS Comment",
|
31 | commonjs2: "CommonJS2 Comment",
|
32 | amd: "AMD Comment"
|
33 | }
|
34 | }
|
35 | })
|
36 |
|
37 | const exempleConfig = Object.assign({}, config, {
|
38 | entry: './src/ison.js',
|
39 | output: {
|
40 | path: path.resolve(__dirname, 'exemple'),
|
41 | filename: 'ison.js',
|
42 | library: 'ison-js',
|
43 | libraryTarget: "umd",
|
44 | auxiliaryComment: {
|
45 | root: "Root Comment",
|
46 | commonjs: "CommonJS Comment",
|
47 | commonjs2: "CommonJS2 Comment",
|
48 | amd: "AMD Comment"
|
49 | }
|
50 | }
|
51 | })
|
52 |
|
53 |
|
54 | module.exports = [prodConfig, exempleConfig] |
\ | No newline at end of file |