2021-03-20 17:32:11 +07:00
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: './src/index.js',
|
2021-03-21 02:28:47 +07:00
|
|
|
devServer: {
|
|
|
|
contentBase: path.resolve(__dirname, 'dist'),
|
|
|
|
compress: true,
|
|
|
|
port: 3000,
|
|
|
|
},
|
2021-03-20 17:32:11 +07:00
|
|
|
mode: "production",
|
|
|
|
output: {
|
|
|
|
filename: 'main.js',
|
|
|
|
path: path.resolve(__dirname, 'dist'),
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: [".go", ".tsx", ".ts", ".js"],
|
|
|
|
fallback: {
|
|
|
|
"fs": false,
|
|
|
|
"os": false,
|
|
|
|
"util": false,
|
|
|
|
"tls": false,
|
|
|
|
"net": false,
|
|
|
|
"path": false,
|
|
|
|
"zlib": false,
|
|
|
|
"http": false,
|
|
|
|
"https": false,
|
|
|
|
"stream": false,
|
|
|
|
"crypto": false,
|
|
|
|
"crypto-browserify": require.resolve('crypto-browserify'), //if you want to use this module also don't forget npm i crypto-browserify
|
|
|
|
}
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.go$/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: path.resolve(__dirname, '../index.js')
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2021-03-21 02:28:47 +07:00
|
|
|
performance: {
|
|
|
|
assetFilter: (file) => {
|
|
|
|
return !/\.wasm/.test(file)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
ignoreWarnings: [
|
|
|
|
{
|
|
|
|
module: /wasm_exec.js$/
|
|
|
|
}
|
|
|
|
]
|
2021-03-20 17:32:11 +07:00
|
|
|
};
|