Skip to content

Commit

Permalink
chore: 移除针对 pnpm 优化的逻辑,建议加 shamefully-hoist 配置
Browse files Browse the repository at this point in the history
  • Loading branch information
winixt committed Apr 6, 2022
1 parent 5f9d356 commit 1acd6ca
Show file tree
Hide file tree
Showing 11 changed files with 126 additions and 277 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/*.ts

lib
lib
node_modules
61 changes: 0 additions & 61 deletions index.html

This file was deleted.

2 changes: 1 addition & 1 deletion packages/fes-build-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-safe-parser": "^6.0.0",
"rollup-plugin-visualizer": "^5.6.0",
"vite": "^2.8.6",
"vite": "^2.9.1",
"vite-plugin-html": "^3.2.0"
},
"peerDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions packages/fes-plugin-access/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { readFileSync } from 'fs';
import { join } from 'path';
import { resolveInnerDep } from '@fesjs/utils';
import { name } from '../package.json';

const namespace = 'plugin-access';
Expand Down Expand Up @@ -33,7 +32,7 @@ export default (api) => {
path: absoluteFilePath,
content: Mustache.render(readFileSync(join(__dirname, 'runtime/core.tpl'), 'utf-8'), {
REPLACE_ROLES: JSON.stringify(roles),
lodashPath: resolveInnerDep('lodash-es', api.builder),
lodashPath: 'lodash-es',
}),
});

Expand Down
3 changes: 1 addition & 2 deletions packages/fes-plugin-locale/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { readFileSync } from 'fs';
import { join } from 'path';
import { resolveInnerDep } from '@fesjs/utils';
import { getLocalesJSON } from './utils';
import { name } from '../package.json';

Expand Down Expand Up @@ -63,7 +62,7 @@ export default (api) => {
2,
),
BASE_NAVIGATOR: userConfig.baseNavigator,
VUE_I18N_PATH: resolveInnerDep('vue-i18n', api.builder),
VUE_I18N_PATH: 'vue-i18n',
}),
});

Expand Down
5 changes: 2 additions & 3 deletions packages/fes-plugin-monaco-editor/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { readFileSync } from 'fs';
import { join } from 'path';
import { resolveInnerDep } from '@fesjs/utils';
import { name } from '../package.json';

const namespace = 'plugin-monaco-editor';
Expand Down Expand Up @@ -48,14 +47,14 @@ export default (api) => {
api.writeTmpFile({
path: absLoaderFilePath,
content: Mustache.render(readFileSync(join(__dirname, 'runtime/loader.tpl'), 'utf-8'), {
MONACO_EDITOR: resolveInnerDep('monaco-editor', api.builder),
MONACO_EDITOR: 'monaco-editor',
}),
});

api.writeTmpFile({
path: absEditorFilePath,
content: Mustache.render(readFileSync(join(__dirname, 'runtime/editor.tpl'), 'utf-8'), {
LODASH_ES: resolveInnerDep('lodash-es', api.builder),
LODASH_ES: 'lodash-es',
}),
});

Expand Down
5 changes: 2 additions & 3 deletions packages/fes-plugin-qiankun/src/main/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { readFileSync, existsSync } from 'fs';
import { join } from 'path';
import { resolveInnerDep } from '@fesjs/utils';
import { defaultMainRootId, defaultHistoryType, qiankunStateForMicroModelNamespace } from '../constants';
import modifyRoutes from './modifyRoutes';

Expand Down Expand Up @@ -39,8 +38,8 @@ export default function (api) {
content: Mustache.render(readFileSync(join(__dirname, 'runtime/MicroApp.tpl'), 'utf-8'), {
qiankunStateForMicroModelNamespace,
HAS_PLUGIN_MODEL: HAS_PLUGIN_MODEL && existsSync(winPath(join(api.paths.absSrcPath, 'models/qiankunStateForMicro.js'))),
QIANKUN: resolveInnerDep('qiankun', api.builder),
LODASH_ES: resolveInnerDep('lodash-es', api.builder),
QIANKUN: 'qiankun',
LODASH_ES: 'lodash-es',
}),
});

Expand Down
3 changes: 1 addition & 2 deletions packages/fes-plugin-request/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Logger } from '@fesjs/compiler';
import { readFileSync } from 'fs';
import { join } from 'path';
import { resolveInnerDep } from '@fesjs/utils';
import { name } from '../package.json';

const logger = new Logger('fes:plugin-request');
Expand Down Expand Up @@ -45,7 +44,7 @@ export default (api) => {
content: requestTemplate
.replace('REPLACE_DATA_FIELD', JSON.stringify(dataField))
.replace('REPLACE_BASE', base || '')
.replace('AXIOS_PATH', resolveInnerDep('axios', api.builder)),
.replace('AXIOS_PATH', 'axios'),
});
});

Expand Down
2 changes: 0 additions & 2 deletions packages/fes-utils/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import Generator from './Generator';
import winPath from './winPath';
import delay from './delay';
import resolvePkg from './resolvePkg';
import resolveInnerDep from './resolveInnerDep';
import compatESModuleRequire from './compatESModuleRequire';
import cleanRequireCache from './cleanRequireCache';
import parseRequireDeps from './parseRequireDeps';
Expand Down Expand Up @@ -62,7 +61,6 @@ export {
parseRequireDeps,
mergeConfig,
resolvePkg,
resolveInnerDep,
getAppPath,
getPort,
changePort,
Expand Down
12 changes: 0 additions & 12 deletions packages/fes-utils/src/resolveInnerDep.js

This file was deleted.

Loading

0 comments on commit 1acd6ca

Please sign in to comment.