-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
58 lines (54 loc) · 1.34 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
let plugins = [
];
const target = process.env.vtarget || "lib";
if (target === 'use') {
plugins.push(new HtmlWebpackPlugin({
title: 'Vite Wallet'
}))
}
// [TODO] vendor
let webpackConfig = {
// devtool: "source-map",
// mode: 'development',
entry: {
index: target === 'lib' ? './src/index.js' : './src/as.js'
},
output: {
path: path.resolve(__dirname, target === 'lib' ? "./dist" : "fff"),
libraryTarget: 'umd',
library: {
root: "vitecrypto",
amd: "vitecrypto",
commonjs: "vitecrypto"
}
},
module: {
rules: [{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
},
// {
// test: /\*\.worker\.js/,
// use: [{
// loader: 'worker-loader',
// options: {"inline":true,"fallback":false}
// }]
// }
]
},
plugins,
devServer: {
quiet: false,
host: '127.0.0.1',
port: 8089
}
};
module.exports = webpackConfig;