1 | const fs = require('fs')
|
2 | const path = require('path')
|
3 | const webpack = require('webpack')
|
4 | const ROOT_PATH = path.resolve(__dirname);
|
5 | const HtmlWebpackPlugin = require('html-webpack-plugin');
|
6 |
|
7 | let resolve = (dir) => {
|
8 | return path.join(__dirname, './', dir)
|
9 | };
|
10 |
|
11 |
|
12 | console.log(process.env.NODE_ENV)
|
13 |
|
14 | module.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 |