mirror of https://github.com/alibaba/ice.git
Fix: resolve path of regenerator-runtime (#6742)
* fix: resolve path of regenerator-runtime * chore: update defineVitestConfig.test.ts * chore: update defineJestConfig.test.ts
This commit is contained in:
parent
c06cb97806
commit
41be253aa9
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@ice/app': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: resolve path of regenerator-runtime/runtime.js
|
||||||
|
|
@ -9,6 +9,7 @@ const getDefaultTaskConfig = ({ rootDir, command }): Config => {
|
||||||
const defaultLogging = command === 'start' ? 'summary' : 'summary assets';
|
const defaultLogging = command === 'start' ? 'summary' : 'summary assets';
|
||||||
|
|
||||||
const envReplacement = path.join(rootDir, RUNTIME_TMP_DIR, 'env.ts');
|
const envReplacement = path.join(rootDir, RUNTIME_TMP_DIR, 'env.ts');
|
||||||
|
const regeneratorRuntimePath = require.resolve('regenerator-runtime');
|
||||||
return {
|
return {
|
||||||
mode: command === 'start' ? 'development' : 'production',
|
mode: command === 'start' ? 'development' : 'production',
|
||||||
sourceMap: command === 'start' ? 'cheap-module-source-map' : false,
|
sourceMap: command === 'start' ? 'cheap-module-source-map' : false,
|
||||||
|
|
@ -21,7 +22,8 @@ const getDefaultTaskConfig = ({ rootDir, command }): Config => {
|
||||||
'webpack/hot': '@ice/bundles/compiled/webpack/hot',
|
'webpack/hot': '@ice/bundles/compiled/webpack/hot',
|
||||||
// Get absolute path of `regenerator-runtime`, `@swc/helpers`
|
// Get absolute path of `regenerator-runtime`, `@swc/helpers`
|
||||||
// so it's unnecessary to add it to project dependencies.
|
// so it's unnecessary to add it to project dependencies.
|
||||||
'regenerator-runtime': require.resolve('regenerator-runtime'),
|
'regenerator-runtime/runtime.js': regeneratorRuntimePath,
|
||||||
|
'regenerator-runtime': regeneratorRuntimePath,
|
||||||
'@swc/helpers': path.dirname(require.resolve('@swc/helpers/package.json')),
|
'@swc/helpers': path.dirname(require.resolve('@swc/helpers/package.json')),
|
||||||
'universal-env': envReplacement,
|
'universal-env': envReplacement,
|
||||||
'@uni/env': envReplacement,
|
'@uni/env': envReplacement,
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ describe('defineJestConfig', () => {
|
||||||
'^ice/types',
|
'^ice/types',
|
||||||
'^@/(.*)',
|
'^@/(.*)',
|
||||||
'^webpack/hot',
|
'^webpack/hot',
|
||||||
|
'^regenerator-runtime/runtime.js',
|
||||||
'^regenerator-runtime',
|
'^regenerator-runtime',
|
||||||
'^@swc/helpers/(.*)',
|
'^@swc/helpers/(.*)',
|
||||||
'^universal-env',
|
'^universal-env',
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ describe('defineVitestConfig', () => {
|
||||||
'ice/types',
|
'ice/types',
|
||||||
'@',
|
'@',
|
||||||
'webpack/hot',
|
'webpack/hot',
|
||||||
|
'regenerator-runtime/runtime.js',
|
||||||
'regenerator-runtime',
|
'regenerator-runtime',
|
||||||
'@swc/helpers',
|
'@swc/helpers',
|
||||||
'universal-env',
|
'universal-env',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue