mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2025-06-17 18:11:21 +00:00
Remove frank (#81)
This commit is contained in:
50
webpack.config.js
Normal file
50
webpack.config.js
Normal file
@ -0,0 +1,50 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||
|
||||
const production = (process.env.NODE_ENV === 'production');
|
||||
|
||||
const config = {
|
||||
entry: {
|
||||
app: ['./src/fluence.ts']
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
loader: 'ts-loader',
|
||||
exclude: /node_modules/
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
extensions: [ '.tsx', '.ts', '.js']
|
||||
},
|
||||
output: {
|
||||
filename: 'bundle.js',
|
||||
path: path.resolve(__dirname, 'bundle'),
|
||||
},
|
||||
node: {
|
||||
fs: 'empty'
|
||||
},
|
||||
plugins: [
|
||||
new CleanWebpackPlugin(),
|
||||
]
|
||||
};
|
||||
|
||||
if (production) {
|
||||
config.mode = 'production';
|
||||
} else {
|
||||
config.mode = 'development';
|
||||
config.devtool = 'inline-source-map';
|
||||
config.devServer = {
|
||||
contentBase: './bundle',
|
||||
hot: false
|
||||
};
|
||||
config.plugins = [
|
||||
...config.plugins,
|
||||
new webpack.HotModuleReplacementPlugin()
|
||||
];
|
||||
}
|
||||
|
||||
module.exports = config;
|
Reference in New Issue
Block a user