-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support optionally bundling node_modules for --target=node (#1690)
- Loading branch information
1 parent
871ffc7
commit 5355685
Showing
15 changed files
with
198 additions
and
27 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
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,13 +1,4 @@ | ||
const projected = require('./pkg-browser-multiple/projected') | ||
|
||
if(projected.test() !== 'pkg-browser-multiple') { | ||
throw new Error('Invalid module') | ||
} | ||
|
||
const entry = require('./pkg-browser-multiple') | ||
|
||
if(entry.test() !== 'pkg-browser-multiple browser-entry') { | ||
throw new Error('Invalid module') | ||
} | ||
|
||
export const test = {projected, entry} |
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,7 +1,3 @@ | ||
const required = require('./pkg-browser') | ||
|
||
if(required.test() !== 'pkg-browser') { | ||
throw new Error('Invalid module') | ||
} | ||
|
||
export const test = required.test |
3 changes: 3 additions & 0 deletions
3
test/integration/resolve-entries/pkg-browser-multiple/node-entry.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,3 @@ | ||
export function test() { | ||
return 'pkg-browser-multiple main-entry' | ||
} |
4 changes: 2 additions & 2 deletions
4
test/integration/resolve-entries/pkg-browser-multiple/package.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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"name": "pkg-browser-multiple", | ||
"main": "./does-not-exist.js", | ||
"main": "./node-entry.js", | ||
"browser": { | ||
"./projected.js": "./projected-module.js", | ||
"./projected.js": "./projected-browser.js", | ||
"pkg-browser-multiple": "browser-entry.js" | ||
} | ||
} |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
test/integration/resolve-entries/pkg-browser-multiple/projected.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,3 @@ | ||
export function test() { | ||
return 'pkg-main-multiple' | ||
} |
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 @@ | ||
export function test() { | ||
return 'pkg-main' | ||
} |
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,5 +1,5 @@ | ||
{ | ||
"name": "pkg-browser", | ||
"main": "./does-not-exist.js", | ||
"main": "./node-module.js", | ||
"browser": "./browser-module.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
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