Skip to content

Commit

Permalink
testing server side build
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Oct 30, 2023
1 parent 0e3b442 commit 02fa30a
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,11 @@
"@cocreate/unique": "^1.15.5",
"@cocreate/users": "^1.28.2",
"@cocreate/uuid": "^1.7.2"
},
"devDependencies": {
"css-loader": "^6.8.1",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-node-externals": "^3.0.0"
}
}
57 changes: 57 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const path = require('path');
// const webpack = require('webpack');
const nodeExternals = require('webpack-node-externals');

module.exports = {
entry: './src/server.js', // Entry point for your server code
target: 'node-webkit', // node, commonjs// Specifies that the bundle should be targeted for Node.js
// externalsPresets: { node: true },
output: {
filename: 'server.bundle.js', // Output file name
path: path.resolve(__dirname, 'dist'), // Output directory
libraryTarget: 'commonjs',
},
optimization: {
minimize: false, // Prevents minification of the output
},
mode: 'production', // Set the mode to 'production' to optimize the bundle
// externals: [nodeExternals({
// // importType: 'commonjs', // commonjs, amd
// // modulesFromFile: true,
// // allowlist: ['ws', '@cocreate/organizations'],
// allowlist: [
// "@cocreate/authenticate",
// "@cocreate/authorize",
// "@cocreate/config",
// "@cocreate/crud-server",
// "@cocreate/file-server",
// "@cocreate/industry",
// "@cocreate/metrics-server",
// "@cocreate/mongodb",
// // "@cocreate/notification",
// // "@cocreate/organizations",
// "@cocreate/server-side-render",
// "@cocreate/socket-server",
// // "@cocreate/unique",
// // "@cocreate/users",
// // "@cocreate/uuid",
// // "fs",
// // "http",
// // "path",
// // "events",
// 'ws'
// ],

// })]

// externals: [nodeExternals({
// importType: 'commonjs',
// modulesFromFile: true, // Use modules from package.json
// modulesDir: 'node_modules', // Set the node_modules directory
// modulesFromFile: {
// fileName: path.resolve(__dirname, 'package.json'),
// includeInBundle: ['dependencies'], // Include dependencies and peerDependencies
// },
// allowlist: [],
// })]
};

0 comments on commit 02fa30a

Please sign in to comment.