-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for webpack alias an array of paths, #10
fix optional prefix of alias in request when an alias name self contains the prefix
- Loading branch information
Showing
53 changed files
with
370 additions
and
66 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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
coverage: | ||
status: | ||
project: | ||
default: | ||
target: 95% | ||
patch: | ||
default: | ||
target: 90% | ||
target: 95% | ||
|
||
ignore: | ||
- test/.* |
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,6 +1,6 @@ | ||
extends ~Includes/layout | ||
|
||
block head | ||
append head | ||
script | ||
| console.log('Test block head') | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<h1>Test includes</h1><h2>include A</h2><p>mixin A</p><h3>include B</h3><p>mixin B</p><h4>include C</h4><h1>Markdown test</h1> | ||
<p>end</p> |
4 changes: 4 additions & 0 deletions
4
test/cases/include-alias-resolve.plugins/src/includes/include-a.pug
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,4 @@ | ||
include Includes/mixins | ||
h2 include A | ||
+testA | ||
include Includes/include-b |
4 changes: 4 additions & 0 deletions
4
test/cases/include-alias-resolve.plugins/src/includes/include-b.pug
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,4 @@ | ||
include Includes/mixins | ||
h3 include B | ||
+testB | ||
include Includes/include-c |
3 changes: 3 additions & 0 deletions
3
test/cases/include-alias-resolve.plugins/src/includes/include-c.pug
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,3 @@ | ||
h4 include C | ||
include:markdown-it Includes/markdown.md | ||
p end |
1 change: 1 addition & 0 deletions
1
test/cases/include-alias-resolve.plugins/src/includes/markdown.md
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 @@ | ||
# Markdown test |
5 changes: 5 additions & 0 deletions
5
test/cases/include-alias-resolve.plugins/src/includes/mixins.pug
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,5 @@ | ||
mixin testA | ||
p mixin A | ||
|
||
mixin testB | ||
p mixin B |
2 changes: 2 additions & 0 deletions
2
test/cases/include-alias-resolve.plugins/src/template/index.pug
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,2 @@ | ||
h1 Test includes | ||
include Includes/include-a |
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,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": "src", | ||
"paths": { | ||
"Includes/*": ["includes/*"] | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
test/cases/include-alias-resolve.plugins/webpack.config.js
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,41 @@ | ||
const path = require('path'); | ||
const PugPlugin = require('../../pug-plugin'); | ||
const TsConfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); | ||
|
||
const basePath = path.resolve(__dirname); | ||
const webRootPath = path.join(__dirname, 'public/'); | ||
|
||
module.exports = { | ||
stats: { | ||
children: true, | ||
}, | ||
|
||
mode: 'production', | ||
|
||
resolve: { | ||
plugins: [new TsConfigPathsPlugin({ configFile: path.join(basePath, 'tsconfig.json') })], | ||
}, | ||
|
||
output: { | ||
path: webRootPath, | ||
publicPath: '', | ||
}, | ||
|
||
entry: { | ||
index: 'src/template/index.pug', | ||
}, | ||
|
||
plugins: [new PugPlugin()], | ||
|
||
module: { | ||
rules: [ | ||
{ | ||
test: /\.pug$/, | ||
loader: 'pug-loader', | ||
options: { | ||
method: 'render', | ||
}, | ||
}, | ||
], | ||
}, | ||
}; |
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 @@ | ||
<img src="/assets/images/image.f78b30f4.jpeg"><img class="prefix" src="/assets/images/logo.f78b30f4.jpeg"><img class="char" src="/assets/images/logo.f78b30f4.jpeg"><img class="a1" src="/assets/images/logo-a1.f78b30f4.jpeg"><img class="a2" src="/assets/images/logo-a2.f78b30f4.jpeg"><img class="a3" src="/assets/images/logo-a3.f78b30f4.jpeg"><img class="b1" src="/assets/images/logo-b1.f78b30f4.jpeg"><img class="b2" src="/assets/images/logo-b2.f78b30f4.jpeg"><img class="b3" src="/assets/images/logo-b3.f78b30f4.jpeg"><img class="c1" src="/assets/images/logo-c1.f78b30f4.jpeg"><img class="c2" src="/assets/images/logo-c2.f78b30f4.jpeg"><img class="c3" src="/assets/images/logo-c3.f78b30f4.jpeg"><img class="d1" src="/assets/images/logo-d1.f78b30f4.jpeg"><img class="d2" src="/assets/images/logo-d2.f78b30f4.jpeg"><img class="d3" src="/assets/images/logo-d3.f78b30f4.jpeg"> |
Binary file added
BIN
+48.4 KB
test/cases/require-alias-array-compile/src/assets-a/images/logo-a1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.4 KB
test/cases/require-alias-array-compile/src/assets-a/images/logo-a2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.4 KB
test/cases/require-alias-array-compile/src/assets-a/images/logo-a3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.4 KB
test/cases/require-alias-array-compile/src/assets-b/images1/logo-b1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.4 KB
test/cases/require-alias-array-compile/src/assets-b/images2/logo-b2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.4 KB
test/cases/require-alias-array-compile/src/assets-b/images3/logo-b3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.4 KB
test/cases/require-alias-array-compile/src/assets-c/images/logo-c1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.4 KB
test/cases/require-alias-array-compile/src/assets-c/images/logo-c2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.4 KB
test/cases/require-alias-array-compile/src/assets-c/images/logo-c3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.4 KB
test/cases/require-alias-array-compile/src/assets-d/images1/logo-d1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.4 KB
test/cases/require-alias-array-compile/src/assets-d/images2/logo-d2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.4 KB
test/cases/require-alias-array-compile/src/assets-d/images3/logo-d3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.