UNPKG

763 BJavaScriptView Raw
1const fs = require('fs')
2const path = require('path')
3const webpack = require('webpack')
4const ROOT_PATH = path.resolve(__dirname);
5const HtmlWebpackPlugin = require('html-webpack-plugin');
6
7let resolve = (dir) => {
8 return path.join(__dirname, './', dir)
9};
10
11
12console.log(process.env.NODE_ENV)
13
14module.exports = {
15 devtool: 'source-map',
16
17 entry: './src/index.js',
18
19 mode: process.env.NODE_ENV === "production" ? "production" : 'development',
20
21 output: {
22 path: path.resolve(__dirname, '../dist'),
23 publicPath: '/dist/',
24 filename: 'fb-core.min.js',
25 library: 'fb-core',
26 libraryTarget: 'umd',
27 umdNamedDefine: true
28 },
29
30 plugins: [],
31
32 module: {
33 rules: [
34 {
35 test: /\.jsx?$/,
36 exclude: /node_modules/,
37 loader: 'babel-loader'
38 },
39
40 ]
41 }
42};
\No newline at end of file