fix(rspack): ensure process is default import (#420)
This commit is contained in:
parent
819c3f5b90
commit
f3ac0852c1
@ -14,7 +14,6 @@ import { waitForPortOpen } from '@nx/web/src/utils/wait-for-port-open';
|
|||||||
import { fork } from 'child_process';
|
import { fork } from 'child_process';
|
||||||
import type { Express } from 'express';
|
import type { Express } from 'express';
|
||||||
import { cpSync, existsSync, readFileSync, rmSync } from 'fs';
|
import { cpSync, existsSync, readFileSync, rmSync } from 'fs';
|
||||||
import * as process from 'node:process';
|
|
||||||
import { ExecutorContext } from 'nx/src/config/misc-interfaces';
|
import { ExecutorContext } from 'nx/src/config/misc-interfaces';
|
||||||
import { basename, extname, join } from 'path';
|
import { basename, extname, join } from 'path';
|
||||||
import {
|
import {
|
||||||
@ -228,6 +227,16 @@ export function startProxies(
|
|||||||
target: mappedLocationOfHost,
|
target: mappedLocationOfHost,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
secure: sslCert ? false : undefined,
|
secure: sslCert ? false : undefined,
|
||||||
|
pathRewrite: (path) => {
|
||||||
|
let pathRewrite = path;
|
||||||
|
for (const app of staticRemotesConfig.remotes) {
|
||||||
|
if (path.endsWith(app)) {
|
||||||
|
pathRewrite = '/';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return pathRewrite;
|
||||||
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
const proxyServer = (sslCert ? https : http)
|
const proxyServer = (sslCert ? https : http)
|
||||||
|
|||||||
@ -40,6 +40,9 @@ export function withWeb(opts: WithWebOptions = {}) {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
...config,
|
...config,
|
||||||
|
experiments: {
|
||||||
|
css: true,
|
||||||
|
},
|
||||||
module: {
|
module: {
|
||||||
...config.module,
|
...config.module,
|
||||||
rules: [
|
rules: [
|
||||||
@ -51,9 +54,11 @@ export function withWeb(opts: WithWebOptions = {}) {
|
|||||||
{
|
{
|
||||||
test: /\.css$/,
|
test: /\.css$/,
|
||||||
type: 'css',
|
type: 'css',
|
||||||
use: [{
|
use: [
|
||||||
loader: require.resolve('postcss-loader'),
|
{
|
||||||
}]
|
loader: require.resolve('postcss-loader'),
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.scss$|\.sass$/,
|
test: /\.scss$|\.sass$/,
|
||||||
@ -114,7 +119,7 @@ export function withWeb(opts: WithWebOptions = {}) {
|
|||||||
}),
|
}),
|
||||||
new rspack.DefinePlugin({
|
new rspack.DefinePlugin({
|
||||||
'process.env.NODE_ENV': isProd ? "'production'" : "'development'",
|
'process.env.NODE_ENV': isProd ? "'production'" : "'development'",
|
||||||
})
|
}),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user