p5.js-web-editor/webpack/config.server.js
Cassie Tarakajian 8054a532d7
Update to webpack 4 (#1145)
* remove some of the react errors, start to fix webpack HMR errors

* start upgrade to webpack 4

* more stuff to update webpack

* update webpack configs to work with webpack 4

* remove linting from truncate script
2019-08-28 16:08:40 -04:00

46 lines
No EOL
804 B
JavaScript

const fs = require('fs');
const path = require('path');
const nodeExternals = require('webpack-node-externals');
module.exports = {
entry: path.resolve(__dirname, '../server/server.js'),
output: {
path: path.resolve(__dirname, '../dist/'),
filename: 'server.bundle.js',
},
target: 'node',
mode: 'production',
node: {
__filename: true,
__dirname: true,
},
externals: [nodeExternals()],
resolve: {
extensions: ['*', '.js', '.jsx'],
modules: [
'client',
'node_modules',
],
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
babelrc: true
}
}, {
test: /\.json$/,
loader: 'json-loader',
},
],
},
};