-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.config.js
46 lines (42 loc) · 1.33 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
const path = require('path');
const webpack = require('webpack');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const distPath = path.resolve(__dirname, 'dist');
const mochaPath = 'node_modules/mocha';
const trufflePath = 'node_modules/@truffle';
module.exports = {
target: 'node',
mode: 'production',
entry: './index.js',
output: {
filename: 'coralX.build.js',
path: distPath
},
plugins: [
new webpack.BannerPlugin({ banner: '#!/usr/bin/env node', raw: true }),
new CopyWebpackPlugin({
patterns: [
{
from: path.resolve(__dirname, mochaPath),
to: path.join(distPath, mochaPath)
},
{
from: path.resolve(__dirname, trufflePath),
to: path.join(distPath, trufflePath)
}
],
}),
new CleanWebpackPlugin(),
// Make web3 1.0 packable
new webpack.IgnorePlugin({resourceRegExp: /^electron$/})
],
externals: {
'@truffle/config': 'commonjs @truffle/config',
'@truffle/workflow-compile': 'commonjs @truffle/workflow-compile',
'mocha': 'commonjs mocha'
},
optimization: {
minimize: false
}
}