forked from webpack/webpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'webpack:main' into webpack#17861
- Loading branch information
Showing
26 changed files
with
264 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
This configuration will enable the none output for the stats report. | ||
|
||
You see that everything is working nicely together. | ||
|
||
# example.js | ||
|
||
```javascript | ||
console.log("Hello World!"); | ||
``` | ||
|
||
# webpack.config.js | ||
|
||
```javascript | ||
const path = require("path"); | ||
|
||
module.exports = { | ||
output: { | ||
path: path.join(__dirname, "dist"), | ||
filename: "output.js" | ||
}, | ||
stats: "none" | ||
}; | ||
``` | ||
|
||
# dist/output.js | ||
|
||
```javascript | ||
/******/ (() => { // webpackBootstrap | ||
var __webpack_exports__ = {}; | ||
/*!********************!*\ | ||
!*** ./example.js ***! | ||
\********************/ | ||
/*! unknown exports (runtime-defined) */ | ||
/*! runtime requirements: */ | ||
console.log("Hello World!"); | ||
|
||
/******/ })() | ||
; | ||
``` | ||
|
||
# Info | ||
|
||
## Production mode | ||
|
||
``` | ||
``` |
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 @@ | ||
global.NO_REASONS = true; | ||
global.NO_STATS_OPTIONS = true; | ||
global.STATS_COLORS = true; | ||
require("../build-common"); |
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 @@ | ||
console.log("Hello World!"); |
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,29 @@ | ||
This configuration will enable the none output for the stats report. | ||
|
||
You see that everything is working nicely together. | ||
|
||
# example.js | ||
|
||
```javascript | ||
_{{example.js}}_ | ||
``` | ||
|
||
# webpack.config.js | ||
|
||
```javascript | ||
_{{webpack.config.js}}_ | ||
``` | ||
|
||
# dist/output.js | ||
|
||
```javascript | ||
_{{dist/output.js}}_ | ||
``` | ||
|
||
# Info | ||
|
||
## Production mode | ||
|
||
``` | ||
_{{production:stdout}}_ | ||
``` |
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,9 @@ | ||
const path = require("path"); | ||
|
||
module.exports = { | ||
output: { | ||
path: path.join(__dirname, "dist"), | ||
filename: "output.js" | ||
}, | ||
stats: "none" | ||
}; |
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
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 @@ | ||
exports.a = 1; | ||
exports.b = 2; |
1 change: 1 addition & 0 deletions
1
test/cases/chunks/destructuring-assignment/dir2/json/array.json
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 @@ | ||
["a"] |
1 change: 1 addition & 0 deletions
1
test/cases/chunks/destructuring-assignment/dir2/json/object.json
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 @@ | ||
{"a": 1} |
1 change: 1 addition & 0 deletions
1
test/cases/chunks/destructuring-assignment/dir2/json/primitive.json
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 @@ | ||
"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
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 @@ | ||
exports.a = 1; | ||
exports.b = 2; |
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 @@ | ||
["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 @@ | ||
{"a": 1} |
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 @@ | ||
"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
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 @@ | ||
it("should compile and run the test", function() {}); |
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,38 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
function handlePath(path) { | ||
return path.replace(/\\/g, "/"); | ||
} | ||
|
||
module.exports = function readDir(from) { | ||
const collectedFiles = []; | ||
const collectedDirectories = []; | ||
const stack = [from]; | ||
let cursor; | ||
|
||
while ((cursor = stack.pop())) { | ||
const stat = fs.statSync(cursor); | ||
|
||
if (stat.isDirectory()) { | ||
const items = fs.readdirSync(cursor); | ||
|
||
if (from !== cursor) { | ||
const relative = path.relative(from, cursor); | ||
collectedDirectories.push(handlePath(relative)); | ||
} | ||
|
||
for (let i = 0; i < items.length; i++) { | ||
stack.push(path.join(cursor, items[i])); | ||
} | ||
} else { | ||
const relative = path.relative(from, cursor); | ||
collectedFiles.push(handlePath(relative)); | ||
} | ||
} | ||
|
||
return { | ||
files: collectedFiles, | ||
directories: collectedDirectories | ||
}; | ||
} |
Oops, something went wrong.