Skip to content

Commit

Permalink
fix(module-tools): support imports field in package.json (#5923)
Browse files Browse the repository at this point in the history
SoonIter authored Jul 9, 2024

Verified

This commit was signed with the committer’s verified signature.
afrittoli Andrea Frittoli
1 parent 04fbf27 commit 269a468
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/green-tomatoes-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@modern-js/module-tools': patch
---

fix(module-tools): the imports field which is handled as url

fix(module-tools): imports field 被认为了 url
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ const globalNamespace = 'globals';

const HTTP_PATTERNS = /^(https?:)?\/\//;
const DATAURL_PATTERNS = /^data:/;
const HASH_PATTERNS = /#[^#]+$/;
const HASH_PATTERNS = /.#[^#]+$/;
const DATAURL_JAVASCRIPT_PATTERNS = /^data:text\/javascript/;

export const adapterPlugin = (compiler: ICompiler): Plugin => {
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import { rewriteCssUrls } from './utils';
const Processed = Symbol('processed');
const HTTP_PATTERNS = /^(https?:)?\/\//;
const DATAURL_PATTERNS = /^data:/;
const HASH_PATTERNS = /#[^#]+$/;
const HASH_PATTERNS = /.#[^#]+$/;

export const postcssUrlPlugin = (options: {
entryPath: string;

0 comments on commit 269a468

Please sign in to comment.