UNPKG

1.27 kBJavaScriptView Raw
1const path = require('path');
2const webpack = require('webpack');
3const FlowBabelWebpackPlugin = require('flow-babel-webpack-plugin');
4const HtmlWebpackPlugin = require('html-webpack-plugin');
5const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
6const fs = require('fs');
7
8const 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
21const 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
37const 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
54module.exports = [prodConfig, exempleConfig]
\No newline at end of file