p5.js-web-editor/webpack/config.server.js
Cassie Tarakajian 7f2529a973 merge master
2019-09-11 19:05:15 -04:00

46 lines
No EOL
825 B
JavaScript

const fs = require('fs');
const path = require('path');
const nodeExternals = require('webpack-node-externals');
module.exports = {
entry: ['@babel/polyfill', 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',
},
],
},
};