Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fead: use LZW to compress css head meta in the production mode
- Loading branch information
Showing
15 changed files
with
183 additions
and
8 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
19 changes: 19 additions & 0 deletions
19
test/configCases/css/large-css-head-data-compression/index.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,19 @@ | ||
const prod = process.env.NODE_ENV === "production"; | ||
|
||
it("should allow to create css modules", done => { | ||
prod | ||
? __non_webpack_require__("./530.bundle1.js") | ||
: __non_webpack_require__("./large_use-style_js.bundle0.js"); | ||
import("../large/use-style.js").then(({ default: x }) => { | ||
try { | ||
expect(x).toMatchSnapshot(prod ? "prod" : "dev"); | ||
} catch (e) { | ||
return done(e); | ||
} | ||
done(); | ||
}, done); | ||
}); | ||
|
||
it("should allow to process tailwind as global css", done => { | ||
import("../large/tailwind.min.css").then(() => done(), done); | ||
}); |
25 changes: 25 additions & 0 deletions
25
test/configCases/css/large-css-head-data-compression/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,25 @@ | ||
/** @type {import("../../../../").Configuration[]} */ | ||
module.exports = [ | ||
{ | ||
target: "web", | ||
mode: "development", | ||
output: { | ||
uniqueName: "my-app", | ||
cssHeadDataCompression: true | ||
}, | ||
experiments: { | ||
css: true | ||
} | ||
}, | ||
{ | ||
target: "web", | ||
mode: "production", | ||
output: { | ||
cssHeadDataCompression: false | ||
}, | ||
performance: false, | ||
experiments: { | ||
css: 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