Skip to content

Commit

Permalink
fix: add dependencies to bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
ClarkXia committed Aug 15, 2023
1 parent 3dbd20b commit 8d91b58
Show file tree
Hide file tree
Showing 9 changed files with 245 additions and 108 deletions.
5 changes: 4 additions & 1 deletion packages/bundles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
"sass": "1.50.0",
"react-refresh": "0.14.0",
"core-js-pure": "^3.8.1",
"error-stack-parser": "^2.0.6"
"error-stack-parser": "^2.0.6",
"@rspack/core": "0.2.12",
"@rspack/dev-server": "0.2.12",
"@ice/css-modules-hash": "0.0.6"
},
"devDependencies": {
"@types/less": "^3.0.3",
Expand Down
1 change: 1 addition & 0 deletions packages/bundles/src/dev-server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@rspack/dev-server';
2 changes: 2 additions & 0 deletions packages/bundles/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import sass from 'sass';
import swc from '@swc/core';
import esbuild from 'esbuild';
import * as caniuseLite from 'caniuse-lite';
import { getCssModulesLocalIdent } from '@ice/css-modules-hash';

const require = createRequire(import.meta.url);
const swcPluginRemoveExport = require.resolve('@ice/swc-plugin-remove-export');
Expand All @@ -26,6 +27,7 @@ export {

esbuild,
caniuseLite,
getCssModulesLocalIdent,
};

export type { ProcessOptions } from 'postcss';
Expand Down
1 change: 1 addition & 0 deletions packages/bundles/src/rspack.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@rspack/core';
7 changes: 3 additions & 4 deletions packages/ice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
"dependencies": {
"@ice/bundles": "0.1.12",
"@ice/route-manifest": "1.2.0",
"@rspack/core": "0.2.10",
"@rspack/dev-server": "0.2.10",
"@ice/css-modules-hash": "0.0.6",
"@ice/runtime": "^1.2.7",
"@ice/webpack-config": "1.0.19",
"@swc/helpers": "0.5.1",
Expand Down Expand Up @@ -88,7 +85,9 @@
"sass": "^1.50.0",
"unplugin": "^0.9.0",
"webpack": "^5.86.0",
"webpack-dev-server": "^4.7.4"
"webpack-dev-server": "^4.7.4",
"@rspack/core": "0.2.12",
"@rspack/dev-server": "0.2.12"
},
"peerDependencies": {
"react": ">=18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/ice/src/bundler/rspack/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function bundler(
let compiler: MultiCompiler;
let devServer: RspackDevServer;
try {
const { rspack } = await import('@rspack/core');
const { rspack } = await import('@ice/bundles/esm/rspack.js');
compiler = rspack(rspackConfigs);
} catch (error) {
logger.error('Webpack compile error.');
Expand Down
2 changes: 1 addition & 1 deletion packages/ice/src/bundler/rspack/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const start = async ({
devServerConfig,
});

const { RspackDevServer } = await import('@rspack/dev-server');
const { RspackDevServer } = await import('@ice/bundles/esm/dev-server.js');
const devServer = new RspackDevServer(devServerConfig, compiler);

compiler.hooks.done.tap('done', async stats => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ice/src/utils/getCSSModuleIdent.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as path from 'path';
import { getCSSModuleLocalIdent } from '@ice/webpack-config';
import { getCssModulesLocalIdent as getIdentByRust } from '@ice/css-modules-hash';
import { getCssModulesLocalIdent as getIdentByRust } from '@ice/bundles';
import { CSS_MODULES_LOCAL_IDENT_NAME, CSS_MODULES_LOCAL_IDENT_NAME_DEV } from '../constant.js';
import escapeLocalIdent from '../utils/escapeLocalIdent.js';

Expand Down
Loading

0 comments on commit 8d91b58

Please sign in to comment.