mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2025-05-30 01:11:21 +00:00
58 lines
1.3 KiB
JavaScript
58 lines
1.3 KiB
JavaScript
// Generated using webpack-cli https://github.com/webpack/webpack-cli
|
|
|
|
const path = require('path');
|
|
const webpack = require('webpack');
|
|
|
|
// const isProduction = true;
|
|
// uncomment to debug
|
|
const isProduction = false;
|
|
|
|
const config = () => ({
|
|
entry: './src/index.ts',
|
|
output: {
|
|
path: path.resolve('dist'),
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.(js|ts|tsx)$/i,
|
|
use: [
|
|
// force new line
|
|
{
|
|
loader: 'ts-loader',
|
|
options: {
|
|
compilerOptions: {
|
|
declaration: false,
|
|
},
|
|
},
|
|
},
|
|
],
|
|
exclude: ['/node_modules/'],
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: ['.tsx', '.ts', '.js'],
|
|
fallback: {
|
|
buffer: require.resolve('buffer/'),
|
|
},
|
|
},
|
|
plugins: [
|
|
new webpack.ProvidePlugin({
|
|
Buffer: ['buffer', 'Buffer'],
|
|
process: 'process/browser',
|
|
}),
|
|
],
|
|
});
|
|
|
|
module.exports = () => {
|
|
const res = config();
|
|
if (isProduction) {
|
|
res.mode = 'production';
|
|
} else {
|
|
res.mode = 'development';
|
|
}
|
|
|
|
return res;
|
|
};
|