Skip to content

Commit

Permalink
chore: format codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
h-a-n-a committed Sep 8, 2023
1 parent 3e378cc commit 70cd032
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 367 deletions.
1 change: 0 additions & 1 deletion crates/rspack_plugin_swc_js_minimizer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ impl Plugin for SwcJsMinimizerPlugin {
..Default::default()
};


let mangle = MangleOptions {
keep_class_names: minify_options.keep_class_names,
keep_fn_names: minify_options.keep_fn_names,
Expand Down
362 changes: 0 additions & 362 deletions packages/rspack/tests/Stats.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,369 +95,7 @@ describe("Stats", () => {
builtAt: false,
version: false
};
<<<<<<< HEAD
expect(stats?.toJson(statsOptions)).toMatchSnapshot();
=======
expect(stats?.toJson(statsOptions)).toMatchInlineSnapshot(`
{
"assets": [
{
"chunkNames": [
"main",
],
"chunks": [
"main",
],
"emitted": true,
"info": {
"development": false,
"hotModuleReplacement": false,
},
"name": "main.js",
"size": 394,
"type": "asset",
},
],
"assetsByChunkName": {
"main": [
"main.js",
],
},
"chunks": [
{
"auxiliaryFiles": [],
"children": [],
"entry": true,
"files": [
"main.js",
],
"id": "main",
"initial": true,
"modules": [
{
"assets": [],
"chunks": [
"main",
],
"id": "876",
"identifier": "<PROJECT_ROOT>/tests/fixtures/a.js",
"issuer": "<PROJECT_ROOT>/tests/fixtures/c.js?c=3",
"issuerId": "970",
"issuerName": "./fixtures/c.js?c=3",
"issuerPath": [
{
"id": "661",
"identifier": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"name": "./fixtures/abc-query.js",
},
{
"id": "970",
"identifier": "<PROJECT_ROOT>/tests/fixtures/c.js?c=3",
"name": "./fixtures/c.js?c=3",
},
],
"moduleType": "javascript/auto",
"name": "./fixtures/a.js",
"nameForCondition": "<PROJECT_ROOT>/tests/fixtures/a.js",
"reasons": [
{
"moduleId": "970",
"moduleIdentifier": "<PROJECT_ROOT>/tests/fixtures/c.js?c=3",
"moduleName": "./fixtures/c.js?c=3",
"type": "cjs require",
"userRequest": "./a",
},
],
"size": 55,
"source": "module.exports = function a() {
return "This is a";
};",
"type": "module",
},
{
"assets": [],
"chunks": [
"main",
],
"id": "304",
"identifier": "<PROJECT_ROOT>/tests/fixtures/a.js?a=1",
"issuer": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"issuerId": "661",
"issuerName": "./fixtures/abc-query.js",
"issuerPath": [
{
"id": "661",
"identifier": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"name": "./fixtures/abc-query.js",
},
],
"moduleType": "javascript/auto",
"name": "./fixtures/a.js?a=1",
"nameForCondition": "<PROJECT_ROOT>/tests/fixtures/a.js",
"reasons": [
{
"moduleId": "661",
"moduleIdentifier": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"moduleName": "./fixtures/abc-query.js",
"type": "cjs require",
"userRequest": "./a?a=1",
},
],
"size": 55,
"source": "module.exports = function a() {
return "This is a";
};",
"type": "module",
},
{
"assets": [],
"chunks": [
"main",
],
"id": "970",
"identifier": "<PROJECT_ROOT>/tests/fixtures/c.js?c=3",
"issuer": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"issuerId": "661",
"issuerName": "./fixtures/abc-query.js",
"issuerPath": [
{
"id": "661",
"identifier": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"name": "./fixtures/abc-query.js",
},
],
"moduleType": "javascript/auto",
"name": "./fixtures/c.js?c=3",
"nameForCondition": "<PROJECT_ROOT>/tests/fixtures/c.js",
"reasons": [
{
"moduleId": "661",
"moduleIdentifier": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"moduleName": "./fixtures/abc-query.js",
"type": "cjs require",
"userRequest": "./c?c=3",
},
],
"size": 72,
"source": "module.exports = function b() {
require("./a");
return "This is c";
};",
"type": "module",
},
{
"assets": [],
"chunks": [
"main",
],
"id": "661",
"identifier": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"issuerPath": [],
"moduleType": "javascript/auto",
"name": "./fixtures/abc-query.js",
"nameForCondition": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"reasons": [
{
"type": "entry",
"userRequest": "./fixtures/abc-query",
},
],
"size": 99,
"source": "exports.a = require("./a?a=1");
// exports.b = require("./b?b=2");
exports.c = require("./c?c=3");
",
"type": "module",
},
],
"names": [
"main",
],
"parents": [],
"siblings": [],
"size": 281,
"type": "chunk",
},
],
"entrypoints": {
"main": {
"assets": [
{
"name": "main.js",
"size": 394,
},
],
"assetsSize": 394,
"chunks": [
"main",
],
"name": "main",
},
},
"errors": [],
"errorsCount": 0,
"filteredModules": undefined,
"hash": "089a36c7767bb55f0574",
"logging": {},
"modules": [
{
"assets": [],
"chunks": [
"main",
],
"id": "876",
"identifier": "<PROJECT_ROOT>/tests/fixtures/a.js",
"issuer": "<PROJECT_ROOT>/tests/fixtures/c.js?c=3",
"issuerId": "970",
"issuerName": "./fixtures/c.js?c=3",
"issuerPath": [
{
"id": "661",
"identifier": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"name": "./fixtures/abc-query.js",
},
{
"id": "970",
"identifier": "<PROJECT_ROOT>/tests/fixtures/c.js?c=3",
"name": "./fixtures/c.js?c=3",
},
],
"moduleType": "javascript/auto",
"name": "./fixtures/a.js",
"nameForCondition": "<PROJECT_ROOT>/tests/fixtures/a.js",
"reasons": [
{
"moduleId": "970",
"moduleIdentifier": "<PROJECT_ROOT>/tests/fixtures/c.js?c=3",
"moduleName": "./fixtures/c.js?c=3",
"type": "cjs require",
"userRequest": "./a",
},
],
"size": 55,
"source": "module.exports = function a() {
return "This is a";
};",
"type": "module",
},
{
"assets": [],
"chunks": [
"main",
],
"id": "304",
"identifier": "<PROJECT_ROOT>/tests/fixtures/a.js?a=1",
"issuer": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"issuerId": "661",
"issuerName": "./fixtures/abc-query.js",
"issuerPath": [
{
"id": "661",
"identifier": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"name": "./fixtures/abc-query.js",
},
],
"moduleType": "javascript/auto",
"name": "./fixtures/a.js?a=1",
"nameForCondition": "<PROJECT_ROOT>/tests/fixtures/a.js",
"reasons": [
{
"moduleId": "661",
"moduleIdentifier": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"moduleName": "./fixtures/abc-query.js",
"type": "cjs require",
"userRequest": "./a?a=1",
},
],
"size": 55,
"source": "module.exports = function a() {
return "This is a";
};",
"type": "module",
},
{
"assets": [],
"chunks": [
"main",
],
"id": "970",
"identifier": "<PROJECT_ROOT>/tests/fixtures/c.js?c=3",
"issuer": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"issuerId": "661",
"issuerName": "./fixtures/abc-query.js",
"issuerPath": [
{
"id": "661",
"identifier": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"name": "./fixtures/abc-query.js",
},
],
"moduleType": "javascript/auto",
"name": "./fixtures/c.js?c=3",
"nameForCondition": "<PROJECT_ROOT>/tests/fixtures/c.js",
"reasons": [
{
"moduleId": "661",
"moduleIdentifier": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"moduleName": "./fixtures/abc-query.js",
"type": "cjs require",
"userRequest": "./c?c=3",
},
],
"size": 72,
"source": "module.exports = function b() {
require("./a");
return "This is c";
};",
"type": "module",
},
{
"assets": [],
"chunks": [
"main",
],
"id": "661",
"identifier": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"issuerPath": [],
"moduleType": "javascript/auto",
"name": "./fixtures/abc-query.js",
"nameForCondition": "<PROJECT_ROOT>/tests/fixtures/abc-query.js",
"reasons": [
{
"type": "entry",
"userRequest": "./fixtures/abc-query",
},
],
"size": 99,
"source": "exports.a = require("./a?a=1");
// exports.b = require("./b?b=2");
exports.c = require("./c?c=3");
",
"type": "module",
},
],
"namedChunkGroups": {
"main": {
"assets": [
{
"name": "main.js",
"size": 394,
},
],
"assetsSize": 394,
"chunks": [
"main",
],
"name": "main",
},
},
"outputPath": "<PROJECT_ROOT>/dist",
"publicPath": "auto",
"warnings": [],
"warningsCount": 0,
}
`);
>>>>>>> ad2aa2112 (chore: update snap)
});

it("should output the specified number of modules when set stats.modulesSpace", async () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/rspack/tests/__snapshots__/Stats.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ exports[`Stats should have stats 1`] = `
"errors": [],
"errorsCount": 0,
"filteredModules": undefined,
"hash": "b32fac08a5e8721cacff",
"hash": "31124a919605602fc9ae",
"logging": {},
"modules": [
{
Expand Down Expand Up @@ -416,7 +416,7 @@ exports.c = require("./c?c=3");
"errors": [],
"errorsCount": 0,
"filteredModules": undefined,
"hash": "5eccb83e369e53af1313",
"hash": "089a36c7767bb55f0574",
"logging": {},
"modules": [
{
Expand Down
Loading

0 comments on commit 70cd032

Please sign in to comment.