Skip to content

Commit

Permalink
Merge pull request #159 from Exabyte-io/chore/add-craco
Browse files Browse the repository at this point in the history
chore: add craco to have a single build bundle
  • Loading branch information
timurbazhirov authored Jan 15, 2025
2 parents e1c2496 + 63b6f96 commit 759ea9a
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 2 deletions.
24 changes: 24 additions & 0 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const path = require("path");

module.exports = {
webpack: {
configure: (webpackConfig) => {
// Disable code splitting
webpackConfig.optimization.splitChunks = {
cacheGroups: {
default: false,
},
};

webpackConfig.optimization.runtimeChunk = false;

// Ensure output filename is a single file
webpackConfig.output.filename = "static/js/[name].bundle.js";

// Set the output directory to a specific folder
webpackConfig.output.path = path.resolve(__dirname, "build");

return webpackConfig;
},
},
};
68 changes: 68 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.0.0",
"description": "Web-based Atomic Viewer and Editor in JavaScript.",
"scripts": {
"build": "SKIP_PREFLIGHT_CHECK=true react-scripts --openssl-legacy-provider build",
"start": "cross-env PORT=3002 SKIP_PREFLIGHT_CHECK=true react-scripts --openssl-legacy-provider start",
"build": "SKIP_PREFLIGHT_CHECK=true craco --openssl-legacy-provider build",
"start": "cross-env PORT=3002 SKIP_PREFLIGHT_CHECK=true craco --openssl-legacy-provider start",
"transpile": "tsc && npm run copy-css",
"copy-css": "mkdir -p dist/stylesheets && cp src/stylesheets/* dist/stylesheets/",
"prestart": "npm-link-shared ./node_modules/@exabyte-io/cove.js/node_modules . react",
Expand Down Expand Up @@ -60,6 +60,7 @@
"react-dom": "^17.0.0"
},
"devDependencies": {
"@craco/craco": "^6.4.5",
"@exabyte-io/cove.js": "2024.7.31-0",
"@exabyte-io/eslint-config": "^2025.1.15-0",
"@mat3ra/code": "^2024.3.25-3",
Expand Down

0 comments on commit 759ea9a

Please sign in to comment.