Skip to content

Commit

Permalink
use babel chunk path name plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ayan4m1 committed Sep 22, 2024
1 parent 1a7da16 commit c7018b8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"@babel/preset-env",
["@babel/preset-react", { "runtime": "automatic" }]
],
"ignore": ["./src/workers"]
"ignore": ["./src/workers"],
"plugins": ["path-chunk-name"]
}
13 changes: 13 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"@eslint/js": "^9.11.0",
"autoprefixer": "^10.4.20",
"babel-loader": "^9.2.1",
"babel-plugin-path-chunk-name": "^1.3.1",
"clean-webpack-plugin": "^4.0.0",
"cname-webpack-plugin": "^3.0.0",
"cross-env": "^7.0.3",
Expand Down
31 changes: 8 additions & 23 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,16 @@ import Layout from 'components/Layout';
import SettingsProvider from 'components/SettingsProvider';
import SuspenseFallback from 'components/SuspenseFallback';

const Home = lazy(
() => import(/* webpackChunkName: "home" */ 'components/Home')
);
const FilamentUsage = lazy(
() => import(/* webpackChunkName: "filament" */ 'components/FilamentUsage')
);
const SpoolWeight = lazy(
() => import(/* webpackChunkName: "spool" */ 'components/SpoolWeight')
);
const SpoolDimensions = lazy(
() => import(/* webpackChunkName: "spool" */ 'components/SpoolDimensions')
);
const Home = lazy(() => import('components/Home'));
const FilamentUsage = lazy(() => import('components/FilamentUsage'));
const SpoolWeight = lazy(() => import('components/SpoolWeight'));
const SpoolDimensions = lazy(() => import('components/SpoolDimensions'));
const ExtruderCalibration = lazy(
() =>
import(/* webpackChunkName: "extruder" */ 'components/ExtruderCalibration')
);
const VolumetricFlow = lazy(
() => import(/* webpackChunkName: "flow" */ 'components/VolumetricFlow')
);
const ZAxisCalibration = lazy(
() => import(/* webpackChunkName: "zaxis" */ 'components/ZAxisCalibration')
);
const SpoolDatabase = lazy(
() => import(/* webpackChunkName: "spools" */ 'components/SpoolDatabase')
() => import('components/ExtruderCalibration')
);
const VolumetricFlow = lazy(() => import('components/VolumetricFlow'));
const ZAxisCalibration = lazy(() => import('components/ZAxisCalibration'));
const SpoolDatabase = lazy(() => import('components/SpoolDatabase'));

const root = createRoot(document.getElementById('root'));

Expand Down

0 comments on commit c7018b8

Please sign in to comment.