This repository has been archived by the owner on Dec 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow to pass
context
to PathPlugin, basic tests
- Loading branch information
1 parent
c8628c5
commit 207b164
Showing
5 changed files
with
58 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { | ||
src, webpackConfig, tsconfig, | ||
compile, expectErrors, spec | ||
} from './utils'; | ||
|
||
import { PathPlugin } from '../paths-plugin'; | ||
|
||
spec(__filename, async function() { | ||
src('index.ts', ` | ||
import App from 'ui/app' | ||
const app = new App() | ||
app.render(); | ||
`); | ||
|
||
src('./ui/app/index.ts', ` | ||
export default class App { render() { return 'App' } } | ||
`); | ||
|
||
tsconfig({ | ||
baseUrl: '.', | ||
paths: { | ||
"ui/*": [ "./src/ui/*" ] | ||
} | ||
}); | ||
|
||
const config = webpackConfig(); | ||
(config.resolve as any).plugins = [ new PathPlugin() ]; | ||
let stats = await compile(config); | ||
|
||
expectErrors(stats, 0); | ||
}); |
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