Skip to content

Commit

Permalink
chore(module-tools): add comment for resolve false in browser alias (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
10Derozan authored Oct 23, 2023
1 parent fd865fb commit f31596c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ export const adapterPlugin = (compiler: ICompiler): Plugin => {
? args.path
: getResultPath(originalFilePath, dir, args.kind);
if (resultPath === false) {
debugResolve('empty resolve:', args);
// https://github.com/defunctzombie/package-browser-field-spec
// we may get false when resolve browser field, in this case, we set it a empty object
debugResolve('resolve false:', args);
return {
path: '/empty-stub',
sideEffects: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// In some directory structure, we can not resolve './util.inspect' from 'index.js' in 'object-inspect',
// For example, in bytedance internal monorepo solution, but here we can resolve it.

import xxx from 'object-inspect';

console.log('xxx:', xxx);
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ import { defineConfig } from '@modern-js/module-tools/defineConfig';
export default defineConfig({
buildConfig: {
input: ['./index.ts'],
platform: 'browser',
},
});

0 comments on commit f31596c

Please sign in to comment.