up
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
const path = require('path');
|
||||
const nodeExternals = require('webpack-node-externals');
|
||||
const {CleanWebpackPlugin} = require('clean-webpack-plugin');
|
||||
const webpackconfig = {
|
||||
target: 'node',
|
||||
mode: 'development',
|
||||
entry: {
|
||||
server: path.resolve('bin/main.js')
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
||||
alias: {
|
||||
'app': path.resolve('app'),
|
||||
'bin': path.resolve('bin'),
|
||||
'config': path.resolve('config'),
|
||||
'middleware': path.resolve('middleware'),
|
||||
'public': path.resolve('public'),
|
||||
},
|
||||
},
|
||||
devtool: 'eval-source-map',
|
||||
output: {
|
||||
filename: '[name].bundle.js',
|
||||
path: path.resolve('./dist')
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\/(js|jsx)$/,
|
||||
use: {
|
||||
loader: 'babel-loader'
|
||||
},
|
||||
exclude: [path.resolve('/node_modules')]
|
||||
}
|
||||
],
|
||||
},
|
||||
externals: [nodeExternals()],
|
||||
plugins: [
|
||||
new CleanWebpackPlugin()
|
||||
],
|
||||
node: {
|
||||
console: true,
|
||||
global: true,
|
||||
process: true,
|
||||
Buffer: true,
|
||||
__filename: true,
|
||||
__dirname: true,
|
||||
setImmediate: true,
|
||||
path: true
|
||||
}
|
||||
}
|
||||
module.exports = webpackconfig
|
||||
Reference in New Issue
Block a user