oneuptime/js-sdk/webpack.config.js

45 lines
1015 B
JavaScript
Raw Normal View History

2020-06-08 17:28:12 +00:00
const path = require('path');
2020-10-15 15:41:18 +00:00
const serverBuild = {
2020-06-09 15:15:12 +00:00
mode: 'production',
2020-11-03 18:53:08 +00:00
entry: './src/index.js',
2020-10-15 10:03:12 +00:00
target: 'node',
2020-06-09 15:15:12 +00:00
output: {
path: path.resolve('dist'),
filename: 'fyipe.js',
2021-01-13 09:42:40 +00:00
library: 'Fyipe',
2020-10-15 10:03:12 +00:00
libraryExport: 'default',
libraryTarget: 'umd',
2020-10-15 11:06:32 +00:00
globalObject: 'this',
2020-06-09 15:15:12 +00:00
},
module: {
rules: [
{
test: /\.js?$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
},
},
],
},
resolve: {
extensions: ['.js'],
},
2021-02-17 16:29:38 +00:00
node: {
fs: 'empty',
2021-03-06 18:30:25 +00:00
child_process: 'empty',
net: 'empty',
2021-04-05 04:23:57 +00:00
module: 'empty',
2021-02-17 16:29:38 +00:00
},
2020-06-09 15:15:12 +00:00
};
2021-04-14 11:01:40 +00:00
/*const webBuild = {
2020-10-15 15:41:18 +00:00
...serverBuild,
target: 'web',
output: { ...serverBuild.output, filename: 'fyipe.min.js' },
2021-04-14 11:01:40 +00:00
};*/
module.exports = serverBuild;