-
-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added
baseUri
option support (from entry options) (#915)
- Loading branch information
Showing
21 changed files
with
152 additions
and
0 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
Binary file added
BIN
+34.6 KB
test/cases/base-uri-in-entry/expected/webpack-5-importModule/asset/roboto-v18-latin-300.ttf
Binary file not shown.
7 changes: 7 additions & 0 deletions
7
test/cases/base-uri-in-entry/expected/webpack-5-importModule/index.css
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,7 @@ | ||
@font-face { | ||
font-family: Roboto-plp; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: url(my-scheme://uri/assets/asset/roboto-v18-latin-300.ttf) format("truetype"); | ||
} | ||
|
3 changes: 3 additions & 0 deletions
3
test/cases/base-uri-in-entry/expected/webpack-5-importModule/index.mjs
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 @@ | ||
var __webpack_exports__ = {}; | ||
|
||
|
Binary file added
BIN
+34.6 KB
test/cases/base-uri-in-entry/expected/webpack-5/asset/roboto-v18-latin-300.ttf
Binary file not shown.
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,7 @@ | ||
@font-face { | ||
font-family: Roboto-plp; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: url(/assets/asset/roboto-v18-latin-300.ttf) format("truetype"); | ||
} | ||
|
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 @@ | ||
var __webpack_exports__ = {}; | ||
|
||
|
Binary file not shown.
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 @@ | ||
import "./main.css"; |
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,6 @@ | ||
@font-face { | ||
font-family: Roboto-plp; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: url("./fonts/roboto-v18-latin-300.ttf") format("truetype"); | ||
} |
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,48 @@ | ||
import Self from "../../../src"; | ||
|
||
/** | ||
* @type {import('webpack').Configuration} | ||
*/ | ||
module.exports = { | ||
mode: "production", | ||
devtool: false, | ||
entry: { | ||
index: { | ||
import: "./index.js", | ||
baseUri: "my-scheme://uri", | ||
}, | ||
}, | ||
optimization: { | ||
minimize: false, | ||
}, | ||
output: { | ||
module: true, | ||
assetModuleFilename: "asset/[name][ext]", | ||
chunkFormat: "module", | ||
chunkLoading: "import", | ||
}, | ||
experiments: { | ||
outputModule: true, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.css$/i, | ||
use: [ | ||
{ | ||
loader: Self.loader, | ||
}, | ||
"css-loader", | ||
], | ||
}, | ||
{ | ||
test: /\.ttf$/i, | ||
type: "asset/resource", | ||
generator: { | ||
publicPath: "/assets/", | ||
}, | ||
}, | ||
], | ||
}, | ||
plugins: [new Self({ experimentalUseImportModule: true })], | ||
}; |
Binary file not shown.
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,7 @@ | ||
@font-face { | ||
font-family: Roboto-plp; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: url(/assets/asset/roboto-v18-latin-300.ttf) format("truetype"); | ||
} | ||
|
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 @@ | ||
var __webpack_exports__ = {}; | ||
|
||
|
Binary file not shown.
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 @@ | ||
import "./main.css"; |
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,6 @@ | ||
@font-face { | ||
font-family: Roboto-plp; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: url("./fonts/roboto-v18-latin-300.ttf") format("truetype"); | ||
} |
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,45 @@ | ||
import Self from "../../../src"; | ||
|
||
/** | ||
* @type {import('webpack').Configuration} | ||
*/ | ||
module.exports = { | ||
mode: "production", | ||
devtool: false, | ||
entry: { | ||
index: "./index.js", | ||
}, | ||
optimization: { | ||
minimize: false, | ||
}, | ||
output: { | ||
module: true, | ||
assetModuleFilename: "asset/[name][ext]", | ||
chunkFormat: "module", | ||
chunkLoading: "import", | ||
}, | ||
experiments: { | ||
outputModule: true, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.css$/i, | ||
use: [ | ||
{ | ||
loader: Self.loader, | ||
}, | ||
"css-loader", | ||
], | ||
}, | ||
{ | ||
test: /\.ttf$/i, | ||
type: "asset/resource", | ||
generator: { | ||
publicPath: "/assets/", | ||
}, | ||
}, | ||
], | ||
}, | ||
plugins: [new Self({ experimentalUseImportModule: true })], | ||
}; |
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