-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
244 additions
and
971 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,40 @@ | ||
import { BabelTarget } from './babel-target' | ||
import { DEV_SERVER_CLIENT } from './constants' | ||
|
||
import Dependency = require('webpack/lib/Dependency') | ||
import ModuleDependency = require('webpack/lib/dependencies/ModuleDependency') | ||
|
||
export interface EntryLoc { | ||
interface EntryLoc { | ||
name: string | ||
index?: number | ||
} | ||
|
||
export interface BabelTargetEntryDependency extends Dependency { | ||
babelTarget: BabelTarget | ||
loc: EntryLoc | ||
name: string | ||
// TODO what's makeSerializable? | ||
export class BabelTargetEntryDependency extends ModuleDependency { | ||
|
||
public name: string | ||
public loc: EntryLoc | ||
|
||
public get type(): string { | ||
return 'babel target entry' | ||
} | ||
|
||
public getResourceIdentifier(): string { | ||
return `module${this.request}!${this.babelTarget.key}` | ||
} | ||
|
||
public get category(): string { | ||
return 'esm' | ||
} | ||
|
||
constructor(public babelTarget: BabelTarget, request: string, public originalName: string, loc?: EntryLoc) { | ||
super(`${request.startsWith(DEV_SERVER_CLIENT) ? request : babelTarget.getTargetedRequest(request)}`) | ||
|
||
this.name = babelTarget.getTargetedAssetName(originalName) | ||
if (!loc) { | ||
loc = { name: `${this.request}:${babelTarget.key}` } | ||
} else { | ||
loc.name += `:${babelTarget.key}` | ||
} | ||
this.loc = loc | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.